From eeb701d1e5419c3431a5b8ba22b61b6aa2688001 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Fri, 27 May 2022 18:14:12 -0600 Subject: [PATCH] fix: Save settings when they are changed, not just on unload --- src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.ts b/src/main.ts index b9131d6..d7c79e5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -48,6 +48,7 @@ export default class FileHider extends Plugin { let rule = createStyleLine(`folder`, file.path); this.style.insertRule(rule); this.settings.hiddenFolders.push(file.path); + this.saveSettings(); }); }; }); @@ -66,6 +67,7 @@ export default class FileHider extends Plugin { let rule = createStyleLine(`file`, file.path); this.style.insertRule(rule); this.settings.hiddenFiles.push(file.path); + this.saveSettings(); }); }; }); @@ -128,6 +130,7 @@ export default class FileHider extends Plugin { this.style.disabled = false; }; this.settings.hidden = !this.settings.hidden; + this.saveSettings(); }; unhideFolder(folder: string) { @@ -141,6 +144,7 @@ export default class FileHider extends Plugin { this.style.deleteRule(parseInt(j)); }; }; + this.saveSettings(); }; unhideFile(file: string) { @@ -157,6 +161,7 @@ export default class FileHider extends Plugin { break; }; }; + this.saveSettings(); } };