fix: init notes on vault clear & delete

This commit is contained in:
thecodrr
2021-12-29 10:51:50 +05:00
parent dbbf4a118e
commit 1cbbce6019

View File

@@ -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)
);