unified/simplified protecting notes & subtree

This commit is contained in:
zadam
2020-02-26 16:37:17 +01:00
parent 3752cf8cba
commit 7bcae9981b
13 changed files with 84 additions and 90 deletions

View File

@@ -186,13 +186,15 @@ async function createTextNote(parentNoteId, title, content = "", params = {}) {
return await createNewNote(params);
}
async function protectNoteRecursively(note, protect, taskContext) {
async function protectNoteRecursively(note, protect, includingSubTree, taskContext) {
await protectNote(note, protect);
taskContext.increaseProgressCount();
for (const child of await note.getChildNotes()) {
await protectNoteRecursively(child, protect, taskContext);
if (includingSubTree) {
for (const child of await note.getChildNotes()) {
await protectNoteRecursively(child, protect, taskContext);
}
}
}