mirror of
https://github.com/laurent22/joplin.git
synced 2026-10-25 02:47:28 +00:00
This commit is contained in:
1 parent
052583a8fb
commit
3f7dde0045
3 files changed
+42
-5
No files matched your search
@@ -300,10 +300,11 @@ export default class ExternalEditWatcher {
|
||||
this.logger().info(`ExternalEditWatcher: Started watching ${filePath}`);
|
||||
}
|
||||
|
||||
public async stopWatching(noteId: string) {
|
||||
// Without a flush, a pending change finds the file removed below and is dropped.
|
||||
public async stopWatching(noteId: string, flushPendingChanges = true) {
|
||||
if (!noteId) return;
|
||||
|
||||
await this.changeEventQueue_.processAllNow();
|
||||
if (flushPendingChanges) await this.changeEventQueue_.processAllNow();
|
||||
|
||||
const filePath = this.noteIdToFilePath_(noteId);
|
||||
if (this.watcher_) this.watcher_.unwatch(filePath);
|
||||
|
||||
Reference in new issue
Block a user