Skip to content

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

fix: init notes on vault clear & delete

thecodrr1cbbce6019bd
diff --git a/packages/core/api/vault.js b/packages/core/api/vault.js
index 7111dad4c..8df12be7d 100644
--- a/packages/core/api/vault.js
+++ b/packages/core/api/vault.js
@@ -120,6 +120,7 @@ export default class Vault {
async clear(password) {
if (await this.unlock(password)) {
+ await this._db.notes.init();
for (var note of this._db.notes.locked) {
await this._unlockNote(note, password, true);
}
@@ -128,6 +129,7 @@ export default class Vault {
async delete(deleteAllLockedNotes = false) {
if (deleteAllLockedNotes) {
+ await this._db.notes.init();
await this._db.notes.remove(
...this._db.notes.locked.map((note) => note.id)
);