diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 4bc3706e9191d2dd40cb9a798e49310def07a845..a0c9a1badf7f022c7afb134579636ee9cdc17f15 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -2,6 +2,7 @@ import { onUnmounted, Ref, ref, watch } from 'vue'; import { $i } from './account'; import { api } from './os'; import { get, set } from './scripts/idb-proxy'; +import { defaultStore } from './store'; import { stream } from './stream'; type StateDef = Record<string, { @@ -95,11 +96,13 @@ export class Storage<T extends StateDef> { } } - private async load(): Promise<void> { + private load(): Promise<void> { return new Promise((resolve, reject) => { if ($i) { // api関数ã¨å¾ªç’°å‚ç…§ãªã®ã§ä¸€å¿œsetTimeoutã—ã¦ãŠã - setTimeout(() => { + setTimeout(async () => { + await defaultStore.ready; + api('i/registry/get-all', { scope: ['client', this.key] }) .then(kvs => { const cache = {};