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

This commit is contained in:
Abdullah Atta
2023-10-02 18:00:36 +05:00
parent 5b9cb8ca4b
commit 577c2ce6cd

View File

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