Compare commits

...

2 Commits

Author SHA1 Message Date
Ammar Ahmed
a7a01d36e4 core: add watch command 2023-10-24 15:48:03 +05:00
Ammar Ahmed
cbefebdb07 core: fix session expired dialog not shown when
user encryption key does not
exist
2023-10-24 15:47:49 +05:00
2 changed files with 5 additions and 1 deletions

View File

@@ -33,6 +33,7 @@
"pretest": "node scripts/prebuild.mjs",
"pretest:e2e": "node scripts/prebuild.mjs",
"build": "tsc",
"watch": "tsc --watch",
"test:e2e": "cross-env IS_E2E=true vitest run",
"test": "vitest run"
},

View File

@@ -240,8 +240,11 @@ class Sync {
const key = await this.db.user.getEncryptionKey();
if (!key || !key.key || !key.salt) {
this.logger.error(
new Error("User encryption key not generated. Please relogin.")
);
EV.publish(EVENTS.userSessionExpired);
throw new Error("User encryption key not generated. Please relogin.");
return;
}
const dbLastSynced = await this.db.lastSynced();