mirror of
https://github.com/groldsf/obsidian_check_plugin.git
synced 2026-07-22 05:37:48 +00:00
disable autoapdate if settings is disabled after settings update
This commit is contained in:
parent
ef0b3017d7
commit
ef380a57bc
1 changed files with 10 additions and 7 deletions
17
src/main.ts
17
src/main.ts
|
|
@ -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);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue