mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-30 16:17:41 +01:00
Add OldBookmarks type to migration wrapper
This commit is contained in:
parent
bd48d929b9
commit
424ec25c5a
2 changed files with 3 additions and 4 deletions
|
@ -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 a new issue