From 019529d76c5f856817b9b1a51d9ed14b13447321 Mon Sep 17 00:00:00 2001 From: tamaina Date: Thu, 30 Dec 2021 01:09:20 +0900 Subject: [PATCH] :v: --- packages/client/src/pizzax.ts | 4 ++-- packages/client/src/ui/deck/deck-store.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 3ac4c5c720..bbd68e762f 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -56,8 +56,8 @@ export class Storage { await this.migrate(); const deviceState: State = await get(this.deviceStateKeyName); - const deviceAccountState = $i ? await get(this.deviceAccountStateKeyName) : {}; - const registryCache = $i ? await get(this.registryCacheKeyName) : {}; + const deviceAccountState = $i ? await get(this.deviceAccountStateKeyName) || {} : {}; + const registryCache = $i ? await get(this.registryCacheKeyName) || {} : {}; for (const [k, v] of Object.entries(this.def) as [keyof T, T[keyof T]][]) { if (v.where === 'device' && Object.prototype.hasOwnProperty.call(deviceState, k)) { diff --git a/packages/client/src/ui/deck/deck-store.ts b/packages/client/src/ui/deck/deck-store.ts index 6b6b02f3f9..c9200ad981 100644 --- a/packages/client/src/ui/deck/deck-store.ts +++ b/packages/client/src/ui/deck/deck-store.ts @@ -61,6 +61,8 @@ export const deckStore = markRaw(new Storage('deck', { export const loadDeck = async () => { let deck; + await deckStore.ready; + try { deck = await api('i/registry/get', { scope: ['client', 'deck', 'profiles'],