diff --git a/src/public/app/services/toast.js b/src/public/app/services/toast.js index 02e2595ca..d51cad528 100644 --- a/src/public/app/services/toast.js +++ b/src/public/app/services/toast.js @@ -54,7 +54,7 @@ function closePersistent(id) { } function showMessage(message, delay = 2000) { - console.debug(utils.now(), "message: ", message); + console.debug(utils.now(), "message:", message); toast({ title: "Info", diff --git a/src/public/app/services/tree_cache.js b/src/public/app/services/tree_cache.js index f8fe862ac..e3649d18f 100644 --- a/src/public/app/services/tree_cache.js +++ b/src/public/app/services/tree_cache.js @@ -203,6 +203,11 @@ class TreeCache { // force to load all the notes at once instead of one by one await this.getNotes(searchResultNoteIds); + // reset all the virtual branches from old search results + if (note.noteId in treeCache.notes) { + treeCache.notes[note.noteId].children = []; + } + const branches = resp.branches.filter(b => b.noteId === note.noteId || b.parentNoteId === note.noteId); searchResultNoteIds.forEach((resultNoteId, index) => branches.push({