From 8d7b4446647537b7bf4305fa912098c8ec3e09ae Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 26 Jun 2023 12:26:21 +0500 Subject: [PATCH] core: autofix issue where locked note is not encrypted --- packages/core/api/vault.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core/api/vault.js b/packages/core/api/vault.js index cd82621bb..63ce67c28 100644 --- a/packages/core/api/vault.js +++ b/packages/core/api/vault.js @@ -251,6 +251,14 @@ export default class Vault { 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( { password }, encryptedContent.data