From 6d2d0fabe035faedb644cc6f13f79fd2b3ae7c20 Mon Sep 17 00:00:00 2001 From: Ran Luo Date: Thu, 3 Oct 2019 21:26:55 +0800 Subject: [PATCH] fix: #1418 Set file watch option usePolling to true on macOS (#1430) * fix: #1418 * Remove debug code --- src/main/filesystem/watcher.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/filesystem/watcher.js b/src/main/filesystem/watcher.js index b9fc3bda..154a5f83 100644 --- a/src/main/filesystem/watcher.js +++ b/src/main/filesystem/watcher.js @@ -134,7 +134,8 @@ class Watcher { // Watch a file or directory and return a unwatch function. watch (win, watchPath, type = 'dir'/* file or dir */) { - const usePolling = this._preferences.getItem('watcherUsePolling') + // TODO: Is it needed to set `watcherUsePolling` ? because macOS need to set to true. + const usePolling = isOsx ? true : this._preferences.getItem('watcherUsePolling') const id = getUniqueId() const watcher = chokidar.watch(watchPath, {