mirror of
https://github.com/barkstone2/vault-to-blog.git
synced 2026-07-22 05:21:19 +00:00
feat: Add onChange event to save comments settings
This commit is contained in:
parent
1403db9e4b
commit
7b6ab09075
1 changed files with 10 additions and 1 deletions
|
|
@ -141,8 +141,9 @@ export class VTBSettingTab extends PluginSettingTab {
|
|||
.setName('Enable Utterances comments layout')
|
||||
.addToggle((cb) => {
|
||||
cb.setValue(this.settings.isEnableComments);
|
||||
cb.onChange((value) => {
|
||||
cb.onChange(async (value) => {
|
||||
this.settings.isEnableComments = value;
|
||||
await this.plugin.saveSettings();
|
||||
this.display()
|
||||
})
|
||||
})
|
||||
|
|
@ -152,6 +153,10 @@ export class VTBSettingTab extends PluginSettingTab {
|
|||
.setName('Repo')
|
||||
.addText((cb) => {
|
||||
cb.setPlaceholder('owner/repo')
|
||||
cb.onChange(async (value) => {
|
||||
this.settings.repo = value;
|
||||
await this.plugin.saveSettings();
|
||||
})
|
||||
})
|
||||
|
||||
new Setting(containerEl)
|
||||
|
|
@ -168,6 +173,10 @@ export class VTBSettingTab extends PluginSettingTab {
|
|||
'boxy-light': 'Boxy Light',
|
||||
'gruvbox-dark': 'Gruvbox Dark',
|
||||
});
|
||||
cb.onChange(async (value) => {
|
||||
this.settings.theme = value;
|
||||
await this.plugin.saveSettings();
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue