Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: do not destroy db on tab/window close

Abdullah Atta6ce08b5aa3b0
diff --git a/apps/web/src/common/db.ts b/apps/web/src/common/db.ts
index b9b9444b2..05cbc0a24 100644
--- a/apps/web/src/common/db.ts
+++ b/apps/web/src/common/db.ts
@@ -100,7 +100,7 @@ async function initializeDatabase(persistence: DatabasePersistence) {
await db.init();
window.addEventListener("beforeunload", () => {
- db.sql().destroy();
+ if (IS_DESKTOP_APP) db.sql().destroy();
});
logger.measure("Database initialization");