Skip to content

Commit 730ee89

Browse files
Hopefully nuke db on failed migration
1 parent ecb63e3 commit 730ee89

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.claude/settings.local.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"permissions": {
33
"allow": [
4-
"Bash(npx tsc:*)"
4+
"Bash(npx tsc:*)",
5+
"Bash(npm ls:*)",
6+
"Bash(nvm ls:*)",
7+
"Bash(source ~/.nvm/nvm.sh)"
58
],
69
"deny": [],
710
"ask": []
811
}
9-
}
12+
}

src/caches/indexeddb.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@ class TileDb extends Dexie {
1515

1616
constructor() {
1717
super("db");
18+
const reset = async () => {
19+
await this.delete();
20+
location.reload();
21+
}
22+
1823
this.version(4).stores({
1924
tiles: "id,layer",
2025
tracks: "++id",
21-
});
26+
})
27+
// Catch with reset to handle migrating to React version.
28+
.catch(reset);
29+
2230
this.version(5).stores({
2331
tiles: "id,layer",
2432
tracks: "++id",

0 commit comments

Comments
 (0)