fix(client): テーマを作成するとクライアントが起動しなくなる

This commit is contained in:
syuilo 2022-07-06 07:08:45 +09:00
parent b35c3114c8
commit efafc31c9b
3 changed files with 17 additions and 3 deletions

View file

@ -97,7 +97,10 @@ const darkThemeId = computed({
return darkTheme.value.id;
},
set(id) {
ColdDeviceStorage.set('darkTheme', themes.value.find(x => x.id === id));
const t = themes.value.find(x => x.id === id);
if (t) { // themes undefined
ColdDeviceStorage.set('darkTheme', t);
}
},
});
const lightTheme = ColdDeviceStorage.ref('lightTheme');
@ -106,7 +109,10 @@ const lightThemeId = computed({
return lightTheme.value.id;
},
set(id) {
ColdDeviceStorage.set('lightTheme', themes.value.find(x => x.id === id));
const t = themes.value.find(x => x.id === id);
if (t) { // themes undefined
ColdDeviceStorage.set('lightTheme', t);
}
},
});
const darkMode = computed(defaultStore.makeGetterSetter('darkMode'));