mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 15:05:31 +08:00
fix removing stale branches from saved search after refresh, fixes #1354
This commit is contained in:
parent
82f410f695
commit
4f75b6aaaf
2 changed files with 6 additions and 1 deletions
|
@ -54,7 +54,7 @@ function closePersistent(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMessage(message, delay = 2000) {
|
function showMessage(message, delay = 2000) {
|
||||||
console.debug(utils.now(), "message: ", message);
|
console.debug(utils.now(), "message:", message);
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Info",
|
title: "Info",
|
||||||
|
|
|
@ -203,6 +203,11 @@ class TreeCache {
|
||||||
// force to load all the notes at once instead of one by one
|
// force to load all the notes at once instead of one by one
|
||||||
await this.getNotes(searchResultNoteIds);
|
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);
|
const branches = resp.branches.filter(b => b.noteId === note.noteId || b.parentNoteId === note.noteId);
|
||||||
|
|
||||||
searchResultNoteIds.forEach((resultNoteId, index) => branches.push({
|
searchResultNoteIds.forEach((resultNoteId, index) => branches.push({
|
||||||
|
|
Loading…
Reference in a new issue