mirror of
https://github.com/tekknoman/obsidian-prio-plugin.git
synced 2026-07-22 07:30:23 +00:00
fix(setting-tab): fixing Save confirmation
This commit is contained in:
parent
10f3f10080
commit
f9c7b5fd95
1 changed files with 2 additions and 4 deletions
|
|
@ -6,9 +6,6 @@ import {PrioPluginSettings} from "./Settings";
|
|||
export class SettingTab extends PluginSettingTab {
|
||||
plugin: PrioPlugin;
|
||||
saveConfirm: SaveConfirm;
|
||||
|
||||
previousSettings: PrioPluginSettings;
|
||||
|
||||
modified = false;
|
||||
|
||||
constructor(app: App, plugin: PrioPlugin) {
|
||||
|
|
@ -26,7 +23,6 @@ export class SettingTab extends PluginSettingTab {
|
|||
}
|
||||
|
||||
display(): void {
|
||||
this.previousSettings = Object.assign({}, this.plugin.settings);
|
||||
const {containerEl} = this;
|
||||
this.plugin.registerDomEvent(document, 'change', () => {
|
||||
this.modified = true;
|
||||
|
|
@ -131,6 +127,7 @@ export class SettingTab extends PluginSettingTab {
|
|||
this.plugin.saveSettings().then(() => {
|
||||
this.plugin.loadSettings().then(() => {
|
||||
new Notice('Settings saved successfully!');
|
||||
this.modified = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -285,5 +282,6 @@ class SaveConfirm extends Modal {
|
|||
onClose() {
|
||||
const {contentEl} = this;
|
||||
contentEl.empty();
|
||||
this.settingsTab.modified = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue