mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 17:26:38 +01:00
fix incorrect switch between protected/unprotected states causing content not being encrypted, fixes #510
This commit is contained in:
@@ -186,8 +186,13 @@ async function protectNoteRecursively(note, protect) {
|
||||
|
||||
async function protectNote(note, protect) {
|
||||
if (protect !== note.isProtected) {
|
||||
const content = await note.getContent();
|
||||
|
||||
note.isProtected = protect;
|
||||
|
||||
// this will force de/encryption
|
||||
await note.setContent(content);
|
||||
|
||||
await note.save();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user