From ef380a57bc1e46ba99fc936298f206211724ef83 Mon Sep 17 00:00:00 2001 From: Grol Grol Date: Fri, 25 Apr 2025 03:09:41 +0300 Subject: [PATCH] disable autoapdate if settings is disabled after settings update --- src/main.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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); + }) + ); + } } }