Skip to content

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

web: call database.setup() before db init

ammarahm-edc881e74aaef4
diff --git a/apps/web/src/common/db.ts b/apps/web/src/common/db.ts
index 94cfae14c..327d76dad 100644
--- a/apps/web/src/common/db.ts
+++ b/apps/web/src/common/db.ts
@@ -28,10 +28,12 @@ let db: Database = {};
async function initializeDatabase(persistence: DatabasePersistence) {
logger.measure("Database initialization");
- const { default: Database } = await import("@notesnook/core/api");
+ const { database } = await import("@notesnook/common");
const { default: FS } = await import("../interfaces/fs");
const { Compressor } = await import("../utils/compressor");
- db = new Database(
+ db = database;
+
+ database.setup(
new NNStorage("Notesnook", persistence),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore