mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
syncification
This commit is contained in:
@@ -6,17 +6,17 @@ const dateUtils = require('../services/date_utils');
|
||||
/**
|
||||
* @param {Note} note
|
||||
*/
|
||||
async function protectNoteRevisions(note) {
|
||||
for (const revision of await note.getRevisions()) {
|
||||
function protectNoteRevisions(note) {
|
||||
for (const revision of note.getRevisions()) {
|
||||
if (note.isProtected !== revision.isProtected) {
|
||||
const content = await revision.getContent();
|
||||
const content = revision.getContent();
|
||||
|
||||
revision.isProtected = note.isProtected;
|
||||
|
||||
// this will force de/encryption
|
||||
await revision.setContent(content);
|
||||
revision.setContent(content);
|
||||
|
||||
await revision.save();
|
||||
revision.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,12 +25,12 @@ async function protectNoteRevisions(note) {
|
||||
* @param {Note} note
|
||||
* @return {NoteRevision}
|
||||
*/
|
||||
async function createNoteRevision(note) {
|
||||
if (await note.hasLabel("disableVersioning")) {
|
||||
function createNoteRevision(note) {
|
||||
if (note.hasLabel("disableVersioning")) {
|
||||
return;
|
||||
}
|
||||
|
||||
const noteRevision = await new NoteRevision({
|
||||
const noteRevision = new NoteRevision({
|
||||
noteId: note.noteId,
|
||||
// title and text should be decrypted now
|
||||
title: note.title,
|
||||
@@ -45,7 +45,7 @@ async function createNoteRevision(note) {
|
||||
dateCreated: dateUtils.localNowDateTime()
|
||||
}).save();
|
||||
|
||||
await noteRevision.setContent(await note.getContent());
|
||||
noteRevision.setContent(note.getContent());
|
||||
|
||||
return noteRevision;
|
||||
}
|
||||
@@ -53,4 +53,4 @@ async function createNoteRevision(note) {
|
||||
module.exports = {
|
||||
protectNoteRevisions,
|
||||
createNoteRevision
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user