close and reset

author
Marijn Besseling <njirambem@gmail.com> · 2026-01-22 20:07 UTC
commit
eaa05026009d47093ff3c8f221316bfd2b007b9a
parent
71e1c0fd7a
tree
browse at this commit

1 file changed +2 -1

Blog/Components/Pages/Storage.razor.js +2 -1

@@ -16,7 +16,7 @@ function InitDB(upgradeCallback) {
16 16
17 17 DBOpenRequest.onupgradeneeded = (e) => {
18 18 writeDebug(`Upgrading from ${e.oldVersion} to ${e.newVersion}`);
19 - upgradeCallback(e);
19 + if (upgradeCallback) upgradeCallback(e);
20 20 };
21 21
22 22 DBOpenRequest.onerror = () => {
@@ -41,6 +41,7 @@ function InitDB(upgradeCallback) {
41 41
42 42 export function onLoad() {
43 43 try {
44 + db?.close();
44 45 db = null;
45 46 InitDB(null);
46 47