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