diff options
Diffstat (limited to 'crates/vfs-notify/src/lib.rs')
-rw-r--r-- | crates/vfs-notify/src/lib.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs index ee5035554..6aaa53f63 100644 --- a/crates/vfs-notify/src/lib.rs +++ b/crates/vfs-notify/src/lib.rs | |||
@@ -82,11 +82,13 @@ impl NotifyActor { | |||
82 | Event::Message(msg) => match msg { | 82 | Event::Message(msg) => match msg { |
83 | Message::Config(config) => { | 83 | Message::Config(config) => { |
84 | self.watcher = None; | 84 | self.watcher = None; |
85 | let (watcher_sender, watcher_receiver) = unbounded(); | 85 | if !config.watch.is_empty() { |
86 | let watcher = log_notify_error(Watcher::new_immediate(move |event| { | 86 | let (watcher_sender, watcher_receiver) = unbounded(); |
87 | watcher_sender.send(event).unwrap() | 87 | let watcher = log_notify_error(Watcher::new_immediate(move |event| { |
88 | })); | 88 | watcher_sender.send(event).unwrap() |
89 | self.watcher = watcher.map(|it| (it, watcher_receiver)); | 89 | })); |
90 | self.watcher = watcher.map(|it| (it, watcher_receiver)); | ||
91 | } | ||
90 | 92 | ||
91 | let n_total = config.load.len(); | 93 | let n_total = config.load.len(); |
92 | self.send(loader::Message::Progress { n_total, n_done: 0 }); | 94 | self.send(loader::Message::Progress { n_total, n_done: 0 }); |