file revisions preview

This commit is contained in:
zadam
2019-11-09 13:01:05 +01:00
parent 60ac1a04f4
commit 664485ccd5
5 changed files with 107 additions and 79 deletions

View File

@@ -9,8 +9,13 @@ const dateUtils = require('../services/date_utils');
async function protectNoteRevisions(note) {
for (const revision of await note.getRevisions()) {
if (note.isProtected !== revision.isProtected) {
const content = await revision.getContent();
revision.isProtected = note.isProtected;
// this will force de/encryption
await revision.setContent(content);
await revision.save();
}
}