mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-20 05:29:32 +01:00
fix: init notes on vault clear & delete
This commit is contained in:
@@ -120,6 +120,7 @@ export default class Vault {
|
|||||||
|
|
||||||
async clear(password) {
|
async clear(password) {
|
||||||
if (await this.unlock(password)) {
|
if (await this.unlock(password)) {
|
||||||
|
await this._db.notes.init();
|
||||||
for (var note of this._db.notes.locked) {
|
for (var note of this._db.notes.locked) {
|
||||||
await this._unlockNote(note, password, true);
|
await this._unlockNote(note, password, true);
|
||||||
}
|
}
|
||||||
@@ -128,6 +129,7 @@ export default class Vault {
|
|||||||
|
|
||||||
async delete(deleteAllLockedNotes = false) {
|
async delete(deleteAllLockedNotes = false) {
|
||||||
if (deleteAllLockedNotes) {
|
if (deleteAllLockedNotes) {
|
||||||
|
await this._db.notes.init();
|
||||||
await this._db.notes.remove(
|
await this._db.notes.remove(
|
||||||
...this._db.notes.locked.map((note) => note.id)
|
...this._db.notes.locked.map((note) => note.id)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user