From 060d4fc27b29058d5bfaccbcaf10402ba1a18c06 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 4 Mar 2021 23:19:27 +0100 Subject: [PATCH] fix duplication of hoisted note tree when hoisted note has clones --- src/public/app/widgets/note_tree.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index ead23e636..7d056e86e 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -1210,7 +1210,7 @@ export default class NoteTreeWidget extends TabAwareWidget { this.tree.clearFilter(); } else { - let found = false; + let found = false;console.log(this.tabContext.notePath, this.tabContext.hoistedNoteId, "ZZZ"); // hack when hoisted note is cloned then it could be filtered multiple times while we want only 1 this.tree.filterBranches(node => { @@ -1218,7 +1218,9 @@ export default class NoteTreeWidget extends TabAwareWidget { return false; } - return found = (node.data.noteId === this.tabContext.hoistedNoteId); + found = node.data.noteId === this.tabContext.hoistedNoteId; + + return found; }); } }