From 5b14358620b8537ac6b0662b2f1bf6414b1c52ad Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 1 Jun 2019 20:54:39 +0200 Subject: [PATCH] fix folder status rendering issues when opening not-yet-loaded notes --- src/public/javascripts/services/tree.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/public/javascripts/services/tree.js b/src/public/javascripts/services/tree.js index 0f98794f4..12feb5f2f 100644 --- a/src/public/javascripts/services/tree.js +++ b/src/public/javascripts/services/tree.js @@ -109,6 +109,8 @@ async function getNodeFromPath(notePath, expand = false, expandOpts = {}) { // we expand only after hoisted note since before then nodes are not actually present in the tree if (parentNode) { + checkFolderStatus(parentNode); + if (!parentNode.isLoaded()) { await parentNode.load(); } @@ -531,7 +533,7 @@ async function collapseTree(node = null) { async function scrollToActiveNote() { const activeContext = noteDetailService.getActiveTabContext(); - if (activeContext) { + if (activeContext && activeContext.notePath) { const node = await expandToNote(activeContext.notePath); node.makeVisible({scrollIntoView: true});