Add OldBookmarks type to migration wrapper

This commit is contained in:
Jip Fr 2023-02-12 14:04:21 +01:00
parent bd48d929b9
commit 424ec25c5a
2 changed files with 3 additions and 4 deletions

View File

@ -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<BookmarkStoreData>()
.setKey("mw-bookmarks")
.addVersion({
version: 0,
migrate(oldBookmarks) {
console.log(oldBookmarks);
migrate(oldBookmarks: OldBookmarks) {
return migrateV1Bookmarks(oldBookmarks);
},
})

View File

@ -27,7 +27,7 @@ export interface OldData {
items: (OldMovie | OldSeries)[];
}
interface OldBookmarks {
export interface OldBookmarks {
bookmarks: (OldMovie | OldSeries)[];
}