Skip to content

Commit

Permalink
fix: storage store inited
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Oct 31, 2024
1 parent 7206894 commit 1f27a15
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/store/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import { getImageId, getImportId } from '@/utils/url';
import localforage from 'localforage';
import type { Reactive } from 'vue';

if (import.meta.hot) {
import.meta.hot.accept(() => {
location.reload();
});
}

interface InitHelper<T> {
waitInit: () => Promise<Reactive<T>>;
inited: globalThis.Ref<boolean>;
Expand Down Expand Up @@ -145,7 +151,7 @@ export const useStorageStore = defineStore('storage', () => {
} as const;

const inited = computed(() => {
return Object.values(data).every((v) => v.init.inited);
return Object.values(data).every((v) => v.init.inited.value);
});
const waitInit = async () => {
if (inited.value) return;
Expand Down

0 comments on commit 1f27a15

Please sign in to comment.