non-search notes should have no children limit, #1673

This commit is contained in:
zadam 2021-03-06 20:31:12 +01:00
parent 9f002fa802
commit 4606e8d118

View File

@ -595,7 +595,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
let childBranches = parentNote.getFilteredChildBranches(); 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); childBranches = childBranches.slice(0, MAX_SEARCH_RESULTS_IN_TREE);
} }
@ -808,8 +808,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
/** @let {FancytreeNode} */ /** @let {FancytreeNode} */
let parentNode = this.getNodesByNoteId('root')[0]; let parentNode = this.getNodesByNoteId('root')[0];
const resolvedNotePathSegments = (await treeService.resolveNotePathToSegments(notePath, this.hoistedNoteId, logErrors)) let resolvedNotePathSegments = await treeService.resolveNotePathToSegments(notePath, this.hoistedNoteId, logErrors);
.slice(1);
if (!resolvedNotePathSegments) { if (!resolvedNotePathSegments) {
if (logErrors) { if (logErrors) {
@ -819,6 +818,8 @@ export default class NoteTreeWidget extends TabAwareWidget {
return; return;
} }
resolvedNotePathSegments = resolvedNotePathSegments.slice(1);
for (const childNoteId of resolvedNotePathSegments) { for (const childNoteId of resolvedNotePathSegments) {
// we expand only after hoisted note since before then nodes are not actually present in the tree // we expand only after hoisted note since before then nodes are not actually present in the tree
if (parentNode) { if (parentNode) {