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(); await this.migrate();
const deviceState: State<T> = await get(this.deviceStateKeyName); const deviceState: State<T> = await get(this.deviceStateKeyName);
const deviceAccountState = $i ? await get(this.deviceAccountStateKeyName) : {}; const deviceAccountState = $i ? await get(this.deviceAccountStateKeyName) || {} : {};
const registryCache = $i ? await get(this.registryCacheKeyName) : {}; const registryCache = $i ? await get(this.registryCacheKeyName) || {} : {};
for (const [k, v] of Object.entries(this.def) as [keyof T, T[keyof T]][]) { 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)) { 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 () => { export const loadDeck = async () => {
let deck; let deck;
await deckStore.ready;
try { try {
deck = await api('i/registry/get', { deck = await api('i/registry/get', {
scope: ['client', 'deck', 'profiles'], scope: ['client', 'deck', 'profiles'],