Skip to content

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

core: don't recreate vault on note open/remove after vault deletion

kashaf-ansari-dev46d5bc83c895
diff --git a/packages/core/src/api/vault.ts b/packages/core/src/api/vault.ts
index 0489f6e12..e9d6d22c2 100644
--- a/packages/core/src/api/vault.ts
+++ b/packages/core/src/api/vault.ts
@@ -182,7 +182,6 @@ export default class Vault {
async remove(noteId: string, password: string) {
await this.unlockNote(noteId, password, true);
- if (!(await this.exists())) await this.create(password);
await this.db.relations.to({ id: noteId, type: "note" }, "vault").unlink();
}
@@ -203,9 +202,9 @@ export default class Vault {
);
if (password) {
- this.password = password;
- if (!(await this.exists())) await this.create(password);
+ await this.unlock(password).catch(() => {});
}
+
return { ...note, content };
}