File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Plugins/Flow.Launcher.Plugin.BrowserBookmark Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -106,17 +106,19 @@ private async Task MonitorRefreshQueue()
106
106
internal static void RegisterBookmarkFile ( string path )
107
107
{
108
108
var directory = Path . GetDirectoryName ( path ) ;
109
- if ( ! Directory . Exists ( directory ) )
109
+ if ( ! Directory . Exists ( directory ) || ! File . Exists ( path ) )
110
+ {
110
111
return ;
111
- var watcher = new FileSystemWatcher ( directory ! ) ;
112
- if ( File . Exists ( path ) )
112
+ }
113
+ if ( Watchers . Any ( x => x . Path . Equals ( directory , StringComparison . OrdinalIgnoreCase ) ) )
113
114
{
114
- var fileName = Path . GetFileName ( path ) ;
115
- watcher . Filter = fileName ;
115
+ return ;
116
116
}
117
+
118
+ var watcher = new FileSystemWatcher ( directory ! ) ;
119
+ watcher . Filter = Path . GetFileName ( path ) ;
117
120
118
121
watcher . NotifyFilter = NotifyFilters . FileName |
119
- NotifyFilters . LastAccess |
120
122
NotifyFilters . LastWrite |
121
123
NotifyFilters . Size ;
122
124
@@ -131,7 +133,7 @@ internal static void RegisterBookmarkFile(string path)
131
133
} ;
132
134
133
135
watcher . EnableRaisingEvents = true ;
134
-
136
+
135
137
Watchers . Add ( watcher ) ;
136
138
}
137
139
You can’t perform that action at this time.
0 commit comments