From 4606e8d118cca83e4717caae33c93abfc4228059 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 6 Mar 2021 20:31:12 +0100 Subject: [PATCH] non-search notes should have no children limit, #1673 --- src/public/app/widgets/note_tree.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index 357e3a8b4..40683ed52 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -595,7 +595,7 @@ export default class NoteTreeWidget extends TabAwareWidget { let childBranches = parentNote.getFilteredChildBranches(); - if (childBranches.length > MAX_SEARCH_RESULTS_IN_TREE) { + if (parentNote.type === 'search' && childBranches.length > MAX_SEARCH_RESULTS_IN_TREE) { childBranches = childBranches.slice(0, MAX_SEARCH_RESULTS_IN_TREE); } @@ -808,8 +808,7 @@ export default class NoteTreeWidget extends TabAwareWidget { /** @let {FancytreeNode} */ let parentNode = this.getNodesByNoteId('root')[0]; - const resolvedNotePathSegments = (await treeService.resolveNotePathToSegments(notePath, this.hoistedNoteId, logErrors)) - .slice(1); + let resolvedNotePathSegments = await treeService.resolveNotePathToSegments(notePath, this.hoistedNoteId, logErrors); if (!resolvedNotePathSegments) { if (logErrors) { @@ -819,6 +818,8 @@ export default class NoteTreeWidget extends TabAwareWidget { return; } + resolvedNotePathSegments = resolvedNotePathSegments.slice(1); + for (const childNoteId of resolvedNotePathSegments) { // we expand only after hoisted note since before then nodes are not actually present in the tree if (parentNode) {