From 5bb2e8203c8f79c007d403e2406bf571e26b93aa Mon Sep 17 00:00:00 2001 From: Jip Fr Date: Wed, 1 Nov 2023 13:57:48 +0100 Subject: [PATCH] Fix migrations --- src/index.tsx | 1 + src/stores/__old/imports.ts | 4 ++++ src/stores/__old/migrations.ts | 2 ++ 3 files changed, 7 insertions(+) create mode 100644 src/stores/__old/imports.ts diff --git a/src/index.tsx b/src/index.tsx index a49d556a..ce39d97e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -15,6 +15,7 @@ import "@/setup/index.css"; import { useLanguageStore } from "@/stores/language"; import { initializeChromecast } from "./setup/chromecast"; +import "./stores/__old/imports"; import { initializeOldStores } from "./stores/__old/migrations"; // initialize diff --git a/src/stores/__old/imports.ts b/src/stores/__old/imports.ts new file mode 100644 index 00000000..bbb658a9 --- /dev/null +++ b/src/stores/__old/imports.ts @@ -0,0 +1,4 @@ +import "./bookmark/store"; +import "./settings/store"; +import "./volume/store"; +import "./watched/store"; diff --git a/src/stores/__old/migrations.ts b/src/stores/__old/migrations.ts index e79113ca..ca00b13f 100644 --- a/src/stores/__old/migrations.ts +++ b/src/stores/__old/migrations.ts @@ -27,6 +27,7 @@ const storeCallbacks: Record void)[]> = {}; const stores: Record, InternalStoreData]> = {}; export async function initializeOldStores() { + console.log(stores); // migrate all stores for (const [store, internal] of Object.values(stores)) { const versions = internal.versions.sort((a, b) => a.version - b.version); @@ -168,6 +169,7 @@ export function createVersionedStore(): StoreBuilder { return this; }, build() { + console.log(_data.key); assertStore(_data); const storageObject = buildStorageObject(_data); stores[_data.key ?? ""] = [storageObject, _data];