mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	return the ability to hide archived notes, closes #1095
This commit is contained in:
		| @@ -576,7 +576,17 @@ export default class NoteTreeWidget extends TabAwareWidget { | |||||||
|  |  | ||||||
|         const noteList = []; |         const noteList = []; | ||||||
|  |  | ||||||
|  |         const hideArchivedNotes = this.hideArchivedNotes; | ||||||
|  |  | ||||||
|         for (const branch of this.getChildBranches(parentNote)) { |         for (const branch of this.getChildBranches(parentNote)) { | ||||||
|  |             if (hideArchivedNotes) { | ||||||
|  |                 const note = await branch.getNote(); | ||||||
|  |  | ||||||
|  |                 if (note.hasLabel('archived')) { | ||||||
|  |                     continue; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |  | ||||||
|             const node = await this.prepareNode(branch); |             const node = await this.prepareNode(branch); | ||||||
|  |  | ||||||
|             noteList.push(node); |             noteList.push(node); | ||||||
| @@ -600,6 +610,11 @@ export default class NoteTreeWidget extends TabAwareWidget { | |||||||
|             childBranches = childBranches.filter(branch => !imageLinks.find(rel => rel.value === branch.noteId)); |             childBranches = childBranches.filter(branch => !imageLinks.find(rel => rel.value === branch.noteId)); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         // we're not checking hideArchivedNotes since that would mean we need to lazy load the child notes | ||||||
|  |         // which would seriously slow down everything. | ||||||
|  |         // we check this flag only once user chooses to expand the parent. This has the negative consequence that | ||||||
|  |         // note may appear as folder but not contain any children when all of them are archived | ||||||
|  |  | ||||||
|         return childBranches; |         return childBranches; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user