From d3ac7b093917e3a54362c757bde637916659d610 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 7 Jun 2019 22:37:10 +0200 Subject: [PATCH] fix disappearing expander in some cases, closes #562 --- src/public/javascripts/services/tree.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/public/javascripts/services/tree.js b/src/public/javascripts/services/tree.js index 12feb5f2f..e0daf47b2 100644 --- a/src/public/javascripts/services/tree.js +++ b/src/public/javascripts/services/tree.js @@ -746,19 +746,11 @@ async function createNoteInto() { } async function checkFolderStatus(node) { - const children = node.getChildren(); const note = await treeCache.getNote(node.data.noteId); - if (!children || children.length === 0) { - node.folder = false; - node.icon = await treeBuilder.getIcon(note); - node.renderTitle(); - } - else if (children && children.length > 0) { - node.folder = true; - node.icon = await treeBuilder.getIcon(note); - node.renderTitle(); - } + node.folder = note.type === 'search' || note.getChildNoteIds().length > 0; + node.icon = await treeBuilder.getIcon(note); + node.renderTitle(); } async function reloadNote(noteId) {