fix removing stale branches from saved search after refresh, fixes #1354

This commit is contained in:
zadam 2020-10-29 22:41:33 +01:00
parent 82f410f695
commit 4f75b6aaaf
2 changed files with 6 additions and 1 deletions

View file

@ -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",

View file

@ -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({