disable autoapdate if settings is disabled after settings update

This commit is contained in:
Grol Grol 2025-04-25 03:09:41 +03:00
parent ef0b3017d7
commit ef380a57bc

View file

@ -41,12 +41,15 @@ export default class CheckboxSyncPlugin extends Plugin {
async updateSettings(callback: (settings: CheckboxSyncPluginSettings) => void | Promise<void>) {
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);
})
);
}
}
}