Skip to content

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

web: fix crash immediately after unlocking app

Abdullah Atta055c109563cb
diff --git a/apps/web/src/root.tsx b/apps/web/src/root.tsx
index 7d7cc5e7c..ca82e8179 100644
--- a/apps/web/src/root.tsx
+++ b/apps/web/src/root.tsx
@@ -55,11 +55,12 @@ export async function startApp() {
await useKeyStore.getState().init();
performance.mark("load:database");
- loadDatabase(
- path !== "/sessionexpired" || Config.get("sessionExpired", false)
- ? "db"
- : "memory"
- );
+ if (!useKeyStore.getState().isLocked)
+ loadDatabase(
+ path !== "/sessionexpired" || Config.get("sessionExpired", false)
+ ? "db"
+ : "memory"
+ );
root.render(
<>