From 424ec25c5ac254df102a98158655bb63631b2d61 Mon Sep 17 00:00:00 2001 From: Jip Fr Date: Sun, 12 Feb 2023 14:04:21 +0100 Subject: [PATCH] Add OldBookmarks type to migration wrapper --- src/state/bookmark/store.ts | 5 ++--- src/state/watched/migrations/v2.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/state/bookmark/store.ts b/src/state/bookmark/store.ts index 5be45812..11bec1c5 100644 --- a/src/state/bookmark/store.ts +++ b/src/state/bookmark/store.ts @@ -1,13 +1,12 @@ import { createVersionedStore } from "@/utils/storage"; -import { migrateV1Bookmarks } from "../watched/migrations/v2"; +import { migrateV1Bookmarks, OldBookmarks } from "../watched/migrations/v2"; import { BookmarkStoreData } from "./types"; export const BookmarkStore = createVersionedStore() .setKey("mw-bookmarks") .addVersion({ version: 0, - migrate(oldBookmarks) { - console.log(oldBookmarks); + migrate(oldBookmarks: OldBookmarks) { return migrateV1Bookmarks(oldBookmarks); }, }) diff --git a/src/state/watched/migrations/v2.ts b/src/state/watched/migrations/v2.ts index c079b32d..946334e8 100644 --- a/src/state/watched/migrations/v2.ts +++ b/src/state/watched/migrations/v2.ts @@ -27,7 +27,7 @@ export interface OldData { items: (OldMovie | OldSeries)[]; } -interface OldBookmarks { +export interface OldBookmarks { bookmarks: (OldMovie | OldSeries)[]; }