Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix loading unnecessary notes into the cache
zadamc4acecd51067
diff --git a/src/routes/api/tree.js b/src/routes/api/tree.jsindex 57e1ad915f..c27ff26e59 100644--- a/src/routes/api/tree.js+++ b/src/routes/api/tree.js@@ -56,12 +56,12 @@ function getTree(req) {const noteIds = sql.getColumn(`WITH RECURSIVE- treeWithDescendants(noteId, isExpanded) AS (- SELECT noteId, 1 FROM branches WHERE parentNoteId = ? AND isDeleted = 0+ treeWithDescendants(noteId) AS (+ SELECT noteId FROM branches WHERE parentNoteId = ? AND isDeleted = 0UNION- SELECT branches.noteId, branches.isExpanded FROM branches+ SELECT branches.noteId FROM branchesJOIN treeWithDescendants ON branches.parentNoteId = treeWithDescendants.noteId- WHERE treeWithDescendants.isExpanded = 1+ WHERE branches.isExpanded = 1AND branches.isDeleted = 0),treeWithDescendantsAndAscendants AS (