Skip to content

Commit a9762c5

Browse files
committed
fix incorrect switch between protected/unprotected states causing content not being encrypted, fixes #510
1 parent 7ce98b0 commit a9762c5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/notes.js

+5
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,13 @@ async function protectNoteRecursively(note, protect) {
186186

187187
async function protectNote(note, protect) {
188188
if (protect !== note.isProtected) {
189+
const content = await note.getContent();
190+
189191
note.isProtected = protect;
190192

193+
// this will force de/encryption
194+
await note.setContent(content);
195+
191196
await note.save();
192197
}
193198

0 commit comments

Comments
 (0)