diff --git a/src/main.ts b/src/main.ts index ebc3c36..a23c16d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -41,12 +41,15 @@ export default class CheckboxSyncPlugin extends Plugin { async updateSettings(callback: (settings: CheckboxSyncPluginSettings) => void | Promise) { await callback(this._settings); await this.saveData(this.settings); - //надо пересинхронизировать все файлы в кеше - const allFile = this.fileStateHolder.getAllFiles(); - await Promise.all( - allFile.map(async (file: TFile) => { - await this.syncController.syncFile(file); - }) - ); + + if (this.settings.enableAutomaticFileSync) { + //надо пересинхронизировать все файлы в кеше + const allFile = this.fileStateHolder.getAllFiles(); + await Promise.all( + allFile.map(async (file: TFile) => { + await this.syncController.syncFile(file); + }) + ); + } } }