From d3cfddd0bdfaeafc994737a3e74943a395690f1d Mon Sep 17 00:00:00 2001 From: RyotaUshio Date: Sat, 25 Nov 2023 22:44:36 +0900 Subject: [PATCH] Fix settings not saved to data.json when rename/delete --- src/manager.ts | 2 ++ src/settings/settings.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/manager.ts b/src/manager.ts index b84b505..f3946e7 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -94,6 +94,7 @@ export class PreambleManager extends Component { onRename(file: TAbstractFile, oldPath: string) { if (file instanceof TFile) this.onFileRename(file, oldPath); if (file instanceof TFolder) this.onFolderRename(file, oldPath); + this.plugin.saveSettings(); } onFileRename(file: TFile, oldPath: string) { @@ -138,6 +139,7 @@ export class PreambleManager extends Component { onDelete(file: TAbstractFile) { if (file instanceof TFile) this.onFileDelete(file); if (file instanceof TFolder) this.onFolderDelete(file); + this.plugin.saveSettings(); } onFileDelete(file: TFile) { diff --git a/src/settings/settings.ts b/src/settings/settings.ts index e5983c2..3f2bbea 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -106,6 +106,7 @@ export class MathJaxPreamblePluginSettingTab extends PluginSettingTab { } async hide() { + super.hide(); if (this.serialized) await this.plugin.manager.deserialize(this.serialized); this.plugin.rerender(); await this.plugin.saveSettings();