note map refactoring

This commit is contained in:
zadam
2021-09-20 23:04:41 +02:00
parent e4ba7d65e8
commit 476b8250c9
7 changed files with 40 additions and 20 deletions

View File

@@ -745,11 +745,15 @@ class Note extends AbstractEntity {
}
/** @return {Note[]} */
getSubtreeNotes() {
getSubtreeNotes(includeArchived = true) {
if (this.isArchived) {
return [];
}
const arr = [[this]];
for (const childNote of this.children) {
arr.push(childNote.getSubtreeNotes());
arr.push(childNote.getSubtreeNotes(includeArchived));
}
return arr.flat();