Skip to content

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

web: fix create vault dialog cannot be closed

Abdullah Atta430c2f51f6ad
diff --git a/apps/web/src/common/vault.ts b/apps/web/src/common/vault.ts
index 5dff64c9b..c7ba2811c 100644
--- a/apps/web/src/common/vault.ts
+++ b/apps/web/src/common/vault.ts
@@ -139,9 +139,13 @@ class Vault {
.catch(({ message }) => {
switch (message) {
case VAULT_ERRORS.noVault:
- return Vault.createVault().then(() => Vault.lockNote(id));
+ return Vault.createVault().then((result) =>
+ result ? Vault.lockNote(id) : false
+ );
case VAULT_ERRORS.vaultLocked:
- return Vault.unlockVault().then(() => Vault.lockNote(id));
+ return Vault.unlockVault().then((result) =>
+ result ? Vault.lockNote(id) : false
+ );
default:
showToast("error", message);
console.error(message);