This commit is contained in:
tamaina 2021-12-30 01:09:20 +09:00
parent 57ee704595
commit 019529d76c
2 changed files with 4 additions and 2 deletions

View File

@ -56,8 +56,8 @@ export class Storage<T extends StateDef> {
await this.migrate();
const deviceState: State<T> = 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)) {

View File

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