Skip to content

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

core: auto create vault if non exists & user opens a locked note

Abdullah Atta577c2ce6cd25
diff --git a/packages/core/src/api/vault.js b/packages/core/src/api/vault.js
index 5c1be944c..ff1a5a401 100644
--- a/packages/core/src/api/vault.js
+++ b/packages/core/src/api/vault.js
@@ -180,7 +180,7 @@ export default class Vault {
if (!note) return;
await this._unlockNote(note.data, password, true);
- if (!this.exists()) await this.create(password);
+ if (!(await this.exists())) await this.create(this.password);
}
/**
@@ -194,7 +194,7 @@ export default class Vault {
const unlockedNote = await this._unlockNote(note.data, password, false);
this._password = password;
- if (!this.exists()) await this.create(this._password);
+ if (!(await this.exists())) await this.create(password);
return unlockedNote;
}