mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: destroy sql database on app close
This commit is contained in:
@@ -98,6 +98,10 @@ async function initializeDatabase(persistence: DatabasePersistence) {
|
||||
|
||||
await db.init();
|
||||
|
||||
window.addEventListener("beforeunload", () => {
|
||||
db.sql().destroy();
|
||||
});
|
||||
|
||||
logger.measure("Database initialization");
|
||||
|
||||
if (db.migrations?.required()) {
|
||||
|
||||
Reference in New Issue
Block a user