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'],