diff --git a/src/client/components/sidebar.vue b/src/client/components/sidebar.vue index 8eace36f19..476c7f8734 100644 --- a/src/client/components/sidebar.vue +++ b/src/client/components/sidebar.vue @@ -242,7 +242,7 @@ export default defineComponent({ addAcount() { os.popup(import('./signin-dialog.vue'), {}, { done: async res => { - addAccount(res.id, res.i); + await addAccount(res.id, res.i); os.success(); }, }, 'closed'); diff --git a/src/client/scripts/idb-proxy.ts b/src/client/scripts/idb-proxy.ts index 986e8ee8dc..804d7ca625 100644 --- a/src/client/scripts/idb-proxy.ts +++ b/src/client/scripts/idb-proxy.ts @@ -1,23 +1,23 @@ // FirefoxのプライベートモードなどではindexedDBが使用不可能なので、使う import { - get as iget, - set as iset, - del as idel + get as iget, + set as iset, + del as idel } from 'idb-keyval'; -const fallbackName = (key: string) => `idbfallback::${key}`; +const fallbackName = (key: string) => `idbfallback::${key}`; export async function get(key: string) { - if (window.indexedDB) return iget(key); - return JSON.parse(localStorage.getItem(fallbackName(key)) || 'null'); + if (window.indexedDB) return iget(key); + return JSON.parse(localStorage.getItem(fallbackName(key))); } export async function set(key: string, val: any) { - if (window.indexedDB) return iset(key, val); - return localStorage.setItem(fallbackName(key), JSON.stringify(val)); + if (window.indexedDB) return iset(key, val); + return localStorage.setItem(fallbackName(key), JSON.stringify(val)); } export async function del(key: string) { - if (window.indexedDB) return idel(key); - return localStorage.removeItem(fallbackName(key)); + if (window.indexedDB) return idel(key); + return localStorage.removeItem(fallbackName(key)); }