diff --git a/src/becca/entities/note.js b/src/becca/entities/note.js index d148363d7..e0b222772 100644 --- a/src/becca/entities/note.js +++ b/src/becca/entities/note.js @@ -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(); diff --git a/src/public/app/services/note_context.js b/src/public/app/services/note_context.js index b51db1ce8..b9588ebd2 100644 --- a/src/public/app/services/note_context.js +++ b/src/public/app/services/note_context.js @@ -39,7 +39,7 @@ class NoteContext extends Component { utils.closeActiveDialog(); this.notePath = resolvedNotePath; - this.noteId = treeService.getNoteIdFromNotePath(resolvedNotePath); + ({noteId: this.noteId, parentNoteId: this.parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(resolvedNotePath)); this.readOnlyTemporarilyDisabled = false; diff --git a/src/public/app/widgets/type_widgets/note_map.js b/src/public/app/widgets/type_widgets/note_map.js index a746d0d7e..e44c4dbdb 100644 --- a/src/public/app/widgets/type_widgets/note_map.js +++ b/src/public/app/widgets/type_widgets/note_map.js @@ -2,6 +2,8 @@ import TypeWidget from "./type_widget.js"; import libraryLoader from "../../services/library_loader.js"; import server from "../../services/server.js"; import attributeService from "../../services/attributes.js"; +import hoistedNoteService from "../../services/hoisted_note.js"; +import appContext from "../../services/app_context.js"; const TPL = `