From bf0fbe201eb7bab849dbc83fe0634cda017a31c0 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 3 Mar 2021 23:00:16 +0100 Subject: [PATCH] hack when hoisted note is cloned then it could be filtered multiple times while we want only 1 --- src/public/app/widgets/note_tree.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index aefc0c2d5..ead23e636 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -1210,7 +1210,16 @@ export default class NoteTreeWidget extends TabAwareWidget { this.tree.clearFilter(); } else { - this.tree.filterBranches(node => node.data.noteId === this.tabContext.hoistedNoteId); + let found = false; + + // hack when hoisted note is cloned then it could be filtered multiple times while we want only 1 + this.tree.filterBranches(node => { + if (found) { + return false; + } + + return found = (node.data.noteId === this.tabContext.hoistedNoteId); + }); } } }