diff --git a/apps/monkey/src/stores/postStore.ts b/apps/monkey/src/stores/postStore.ts index 9a18239..36d0711 100644 --- a/apps/monkey/src/stores/postStore.ts +++ b/apps/monkey/src/stores/postStore.ts @@ -51,7 +51,7 @@ export const usePostStore = defineStore('post', () => { fetchedCount: 0, }) - setDB() + await setDB() await idb.value.clearDB() } @@ -68,8 +68,7 @@ export const usePostStore = defineStore('post', () => { async function getAll() { await waitIDB() - const posts = await idb.value.getAllDBPosts() - return posts + return await idb.value.getAllDBPosts() } async function setCount() { diff --git a/apps/web/src/App.vue b/apps/web/src/App.vue index 59458cc..9045049 100644 --- a/apps/web/src/App.vue +++ b/apps/web/src/App.vue @@ -37,7 +37,9 @@ useHead({ ], }) -const loaded = ref(false) +const route = useRoute() +const loaded = ref(route.path === '/example') + onNuxtReady(async () => { const publicStore = usePublicStore() const users = localStorage.getItem('users') @@ -47,6 +49,8 @@ onNuxtReady(async () => { publicStore.curUid = curUid || '' watchImmediate(() => publicStore.curUid, async () => { + if (route.path === '/example') + return loaded.value = false await publicStore.migrateUser() loaded.value = true diff --git a/apps/web/src/pages/example.vue b/apps/web/src/pages/example.vue index 436055d..f061efe 100644 --- a/apps/web/src/pages/example.vue +++ b/apps/web/src/pages/example.vue @@ -1,5 +1,9 @@