diff --git a/main.ts b/main.ts index f17738a..4745a64 100644 --- a/main.ts +++ b/main.ts @@ -1284,11 +1284,12 @@ export default class ObsidianLiveSyncPlugin extends Plugin { let delay = this.settings.savingDelay; if (delay < 200) delay = 200; if (delay > 5000) delay = 5000; - this.watchVaultChange = debounce(this.watchVaultChange.bind(this), delay, false); + // this.watchVaultChange = debounce(this.watchVaultChange.bind(this), delay, false); // this.watchVaultDelete = debounce(this.watchVaultDelete.bind(this), delay, false); // this.watchVaultRename = debounce(this.watchVaultRename.bind(this), delay, false); - // this.watchVaultChange = this.watchVaultChange.bind(this); + this.watchVaultChange = this.watchVaultChange.bind(this); + this.watchVaultCreate = this.watchVaultCreate.bind(this); this.watchVaultDelete = this.watchVaultDelete.bind(this); this.watchVaultRename = this.watchVaultRename.bind(this); this.watchWorkspaceOpen = debounce(this.watchWorkspaceOpen.bind(this), delay, false); @@ -1442,6 +1443,10 @@ export default class ObsidianLiveSyncPlugin extends Plugin { await this.showIfConflicted(file); this.gcHook(); } + watchVaultCreate(file: TFile, ...args: any[]) { + if (this.settings.suspendFileWatching) return; + this.watchVaultChangeAsync(file, ...args); + } watchVaultChange(file: TFile, ...args: any[]) { if (this.settings.suspendFileWatching) return; this.watchVaultChangeAsync(file, ...args); diff --git a/manifest.json b/manifest.json index a1b44c6..adc3921 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-livesync", "name": "Self-hosted LiveSync", - "version": "0.1.12", + "version": "0.1.13", "minAppVersion": "0.9.12", "description": "Community implementation of self-hosted livesync. Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", "author": "vorotamoroz", diff --git a/package-lock.json b/package-lock.json index 16f2479..ce36ffd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidian-livesync", - "version": "0.1.12", + "version": "0.1.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "obsidian-livesync", - "version": "0.1.12", + "version": "0.1.13", "license": "MIT", "dependencies": { "diff-match-patch": "^1.0.5", diff --git a/package.json b/package.json index 4e089c9..e42eea7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-livesync", - "version": "0.1.12", + "version": "0.1.13", "description": "Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", "main": "main.js", "scripts": {