1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Electron: Fixes #710: Don't unwatch file when it is temporarily deleted

This commit is contained in:
Laurent Cozic 2018-09-13 19:29:48 +01:00
parent 38970e9a52
commit 0a5ad1d628

View File

@ -44,7 +44,13 @@ class ExternalEditWatcher {
this.logger().debug('ExternalEditWatcher: Event: ' + event + ': ' + path); this.logger().debug('ExternalEditWatcher: Event: ' + event + ': ' + path);
if (event === 'unlink') { if (event === 'unlink') {
this.watcher_.unwatch(path); // File are unwatched in the stopWatching functions below. When we receive an unlink event
// here it might be that the file is quickly moved to a different location and replaced by
// another file with the same name, as it happens with emacs. So because of this
// we keep watching anyway.
// See: https://github.com/laurent22/joplin/issues/710#issuecomment-420997167
// this.watcher_.unwatch(path);
} else if (event === 'change') { } else if (event === 'change') {
const id = Note.pathToId(path); const id = Note.pathToId(path);