✌️
This commit is contained in:
parent
57ee704595
commit
019529d76c
|
@ -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)) {
|
||||||
|
|
|
@ -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'],
|
||||||
|
|
Loading…
Reference in a new issue