Skip to content

Commit

Permalink
clear stored creation data to force re-fetching linked creations
Browse files Browse the repository at this point in the history
  • Loading branch information
Eselvire committed Dec 26, 2023
1 parent d3b8d44 commit 04cb73b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ import { ZodInfer } from "./types";

type dbSchema_ = Awaited<ReturnType<typeof idb.openDB<dbSchema>>>;

const db = await idb.openDB<dbSchema_>("mlexporter", 2, {
upgrade(db, oldVersion, newVersion) {
const db = await idb.openDB<dbSchema_>("mlexporter", 3, {
upgrade(db, oldVersion, newVersion, tx) {
console.log("upgrading db from", oldVersion, "to", newVersion);

if (oldVersion < 1) {
Expand Down Expand Up @@ -148,6 +148,10 @@ import { ZodInfer } from "./types";
db.createObjectStore('public-creations-downloaded-prefixes');
db.createObjectStore('public-creations');
}
if (oldVersion < 3) {
log("clearing saved creation data")
tx.objectStore('creations-data-def').clear()
}
}
});
log("creating db OK")
Expand Down

0 comments on commit 04cb73b

Please sign in to comment.