user-config: fix errors on init

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/823/head
Varun Patil 2023-09-12 10:50:53 -07:00
parent 73fdcd9166
commit 41ea6bdc1f
1 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ export default defineComponent({
name: 'UserConfig', name: 'UserConfig',
data: () => ({ data: () => ({
config: { ...staticConfig.getDefault() }, config: { ...staticConfig.getDefault() } as IConfig,
}), }),
created() { created() {
@ -38,9 +38,9 @@ export default defineComponent({
utils.bus.emit(eventName, null); utils.bus.emit(eventName, null);
}, },
updateLocalSetting({ setting, value }) { updateLocalSetting(val: { setting: keyof IConfig; value: IConfig[keyof IConfig] }) {
if (setting) { if (val?.setting) {
this.config[setting] = value; (this.config as any)[val.setting] = val.value;
} }
}, },