diff --git a/main.js b/main.js index 62e6c95..0da3827 100644 --- a/main.js +++ b/main.js @@ -830,6 +830,7 @@ var NeoGDSync = class extends import_obsidian4.Plugin { return false; } handleCreate(f) { + if (this.syncing) return; // sync itself calls writeLocal which fires create events if (this.exclude(f.path)) return; if (!(f instanceof import_obsidian4.TFile)) return; // skip folders const cur = this.pendingOps[f.path]; @@ -842,6 +843,7 @@ var NeoGDSync = class extends import_obsidian4.Plugin { this.debouncedSave(); } handleModify(f) { + if (this.syncing) return; // sync itself calls writeLocal/modifyBinary which fires modify events if (this.exclude(f.path) || !(f instanceof import_obsidian4.TFile)) return; // Skip if file matches snapshot (Obsidian fires modify events on startup for all files) const snap = this.snapshot.get(f.path); diff --git a/src/main.ts b/src/main.ts index e29f134..457abcf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -94,6 +94,7 @@ export default class NeoGDSync extends Plugin { } private handleCreate(f: TAbstractFile) { + if (this.syncing) return; // sync itself calls writeLocal which fires create events if (this.exclude(f.path)) return; if (!(f instanceof TFile)) return; // skip folders const cur = this.pendingOps[f.path]; @@ -107,6 +108,7 @@ export default class NeoGDSync extends Plugin { } private handleModify(f: TAbstractFile) { + if (this.syncing) return; // sync itself calls writeLocal/modifyBinary which fires modify events if (this.exclude(f.path) || !(f instanceof TFile)) return; // Skip if file matches snapshot (avoids false positives on startup events) const snap = this.snapshot.get(f.path);