mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-01-18 16:17:26 +01:00
Fix db crash
This commit is contained in:
@@ -18,6 +18,13 @@ const createDatabase = (username) => {
|
||||
prefs: "&key",
|
||||
});
|
||||
|
||||
// When another connection (e.g., service worker or another tab) wants to upgrade,
|
||||
// close this connection gracefully to allow the upgrade to proceed
|
||||
db.on("versionchange", () => {
|
||||
console.log("[db] versionchange event: closing database");
|
||||
db.close();
|
||||
});
|
||||
|
||||
return db;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user