refactor(client): typed localStorage

This commit is contained in:
syuilo 2023-01-07 10:13:02 +09:00
parent a42b03c154
commit 91503405b4
25 changed files with 157 additions and 88 deletions

View file

@ -5,6 +5,7 @@ import * as os from '@/os';
import { i18n } from '@/i18n';
import { ui } from '@/config';
import { unisonReload } from '@/scripts/unison-reload';
import { miLocalStorage } from './local-storage';
export const navbarItemDef = reactive({
notifications: {
@ -110,21 +111,21 @@ export const navbarItemDef = reactive({
text: i18n.ts.default,
active: ui === 'default' || ui === null,
action: () => {
localStorage.setItem('ui', 'default');
miLocalStorage.setItem('ui', 'default');
unisonReload();
},
}, {
text: i18n.ts.deck,
active: ui === 'deck',
action: () => {
localStorage.setItem('ui', 'deck');
miLocalStorage.setItem('ui', 'deck');
unisonReload();
},
}, {
text: i18n.ts.classic,
active: ui === 'classic',
action: () => {
localStorage.setItem('ui', 'classic');
miLocalStorage.setItem('ui', 'classic');
unisonReload();
},
}], ev.currentTarget ?? ev.target);