mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-13 09:25:07 +01:00
Add OldBookmarks type to migration wrapper
This commit is contained in:
parent
bd48d929b9
commit
424ec25c5a
@ -1,13 +1,12 @@
|
|||||||
import { createVersionedStore } from "@/utils/storage";
|
import { createVersionedStore } from "@/utils/storage";
|
||||||
import { migrateV1Bookmarks } from "../watched/migrations/v2";
|
import { migrateV1Bookmarks, OldBookmarks } from "../watched/migrations/v2";
|
||||||
import { BookmarkStoreData } from "./types";
|
import { BookmarkStoreData } from "./types";
|
||||||
|
|
||||||
export const BookmarkStore = createVersionedStore<BookmarkStoreData>()
|
export const BookmarkStore = createVersionedStore<BookmarkStoreData>()
|
||||||
.setKey("mw-bookmarks")
|
.setKey("mw-bookmarks")
|
||||||
.addVersion({
|
.addVersion({
|
||||||
version: 0,
|
version: 0,
|
||||||
migrate(oldBookmarks) {
|
migrate(oldBookmarks: OldBookmarks) {
|
||||||
console.log(oldBookmarks);
|
|
||||||
return migrateV1Bookmarks(oldBookmarks);
|
return migrateV1Bookmarks(oldBookmarks);
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -27,7 +27,7 @@ export interface OldData {
|
|||||||
items: (OldMovie | OldSeries)[];
|
items: (OldMovie | OldSeries)[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OldBookmarks {
|
export interface OldBookmarks {
|
||||||
bookmarks: (OldMovie | OldSeries)[];
|
bookmarks: (OldMovie | OldSeries)[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user