Skip to content

Commit

Permalink
Refresh config on rename events, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
temochka committed Feb 25, 2021
1 parent f5944e9 commit 4e5acb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Anykey/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4e5acb8

Please sign in to comment.