From 4e5acb85b706f29b38e15ba82dcd845c77adfce6 Mon Sep 17 00:00:00 2001 From: Artem Chistyakov Date: Wed, 24 Feb 2021 20:09:44 -0500 Subject: [PATCH] Refresh config on rename events, too. --- Anykey/AppDelegate.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Anykey/AppDelegate.swift b/Anykey/AppDelegate.swift index 74b3620..44d2151 100644 --- a/Anykey/AppDelegate.swift +++ b/Anykey/AppDelegate.swift @@ -108,8 +108,8 @@ class AppDelegate: NSObject, NSApplicationDelegate { fileWatcher = FileWatcher([configPath()]) fileWatcher.queue = DispatchQueue.global() fileWatcher.callback = { event in - guard event.path == self.configPath() && (event.fileCreated || event.fileModified) else { return } - usleep(200000) + guard event.path == self.configPath() && (event.fileCreated || event.fileModified || event.fileRenamed) else { return } + usleep(200 * 1000) self.loadConfig() } fileWatcher.start()