mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	fix loading unnecessary notes into the cache
This commit is contained in:
		| @@ -56,12 +56,12 @@ function getTree(req) { | |||||||
|  |  | ||||||
|     const noteIds = sql.getColumn(` |     const noteIds = sql.getColumn(` | ||||||
|         WITH RECURSIVE |         WITH RECURSIVE | ||||||
|             treeWithDescendants(noteId, isExpanded) AS ( |             treeWithDescendants(noteId) AS ( | ||||||
|                 SELECT noteId, 1 FROM branches WHERE parentNoteId = ? AND isDeleted = 0 |                 SELECT noteId FROM branches WHERE parentNoteId = ? AND isDeleted = 0 | ||||||
|                 UNION |                 UNION | ||||||
|                 SELECT branches.noteId, branches.isExpanded FROM branches |                 SELECT branches.noteId FROM branches | ||||||
|                   JOIN treeWithDescendants ON branches.parentNoteId = treeWithDescendants.noteId |                   JOIN treeWithDescendants ON branches.parentNoteId = treeWithDescendants.noteId | ||||||
|                 WHERE treeWithDescendants.isExpanded = 1  |                 WHERE branches.isExpanded = 1  | ||||||
|                   AND branches.isDeleted = 0 |                   AND branches.isDeleted = 0 | ||||||
|             ), |             ), | ||||||
|             treeWithDescendantsAndAscendants AS ( |             treeWithDescendantsAndAscendants AS ( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user