core: autofix issue where locked note is not encrypted

This commit is contained in:
Abdullah Atta
2023-06-26 12:26:21 +05:00
committed by Abdullah Atta
parent 4a5c5fd3bf
commit 8d7b444664

View File

@@ -251,6 +251,14 @@ export default class Vault {
password = this._password; password = this._password;
} }
if (encryptedContent.noteId && typeof encryptedContent.data !== "object") {
await this._db.notes.add({
id: encryptedContent.noteId,
locked: false
});
return encryptedContent;
}
let decryptedContent = await this._storage.decrypt( let decryptedContent = await this._storage.decrypt(
{ password }, { password },
encryptedContent.data encryptedContent.data