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
return the ability to hide archived notes, closes #1095
zadam1db892d22f07
diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.jsindex a4006fe19e..bba40add57 100644--- a/src/public/app/widgets/note_tree.js+++ b/src/public/app/widgets/note_tree.js@@ -576,7 +576,17 @@ export default class NoteTreeWidget extends TabAwareWidget {const noteList = [];+ const hideArchivedNotes = this.hideArchivedNotes;+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);noteList.push(node);@@ -600,6 +610,11 @@ export default class NoteTreeWidget extends TabAwareWidget {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;}