correctly respect label @disableVersioning

This commit is contained in:
zadam
2019-12-02 20:21:52 +01:00
parent 2595c3ac31
commit dc063983ea
3 changed files with 5 additions and 8 deletions

View File

@@ -7,10 +7,6 @@ const dateUtils = require('../services/date_utils');
* @param {Note} note
*/
async function protectNoteRevisions(note) {
if (await note.hasLabel('disableVersioning')) {
return;
}
for (const revision of await note.getRevisions()) {
if (note.isProtected !== revision.isProtected) {
const content = await revision.getContent();
@@ -30,6 +26,10 @@ async function protectNoteRevisions(note) {
* @return {NoteRevision}
*/
async function createNoteRevision(note) {
if (await note.hasLabel("disableVersioning")) {
return;
}
const noteRevision = await new NoteRevision({
noteId: note.noteId,
// title and text should be decrypted now