mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix incorrect switch between protected/unprotected states causing content not being encrypted, fixes #510
This commit is contained in:
parent
7ce98b0b28
commit
a9762c5139
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"version": "0.31.3",
|
"version": "0.31.4",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -186,8 +186,13 @@ async function protectNoteRecursively(note, protect) {
|
|||||||
|
|
||||||
async function protectNote(note, protect) {
|
async function protectNote(note, protect) {
|
||||||
if (protect !== note.isProtected) {
|
if (protect !== note.isProtected) {
|
||||||
|
const content = await note.getContent();
|
||||||
|
|
||||||
note.isProtected = protect;
|
note.isProtected = protect;
|
||||||
|
|
||||||
|
// this will force de/encryption
|
||||||
|
await note.setContent(content);
|
||||||
|
|
||||||
await note.save();
|
await note.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user