Skip to content

Build your personal knowledge base with Trilium Notes

change of archived label should force a reload of the parents since it can change its visibility status, fixes #3422

zadamc4b0c4491979
diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js
index 576aa7da75..1de9aa5a51 100644
--- a/src/public/app/widgets/note_tree.js
+++ b/src/public/app/widgets/note_tree.js
@@ -1047,7 +1047,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
const noteIdsToReload = new Set();
for (const ecAttr of loadResults.getAttributes()) {
- if (ecAttr.type === 'label' && ['iconClass', 'cssClass', 'workspace', 'workspaceIconClass', 'archived', 'color'].includes(ecAttr.name)) {
+ if (ecAttr.type === 'label' && ['iconClass', 'cssClass', 'workspace', 'workspaceIconClass', 'color'].includes(ecAttr.name)) {
if (ecAttr.isInheritable) {
noteIdsToReload.add(ecAttr.noteId);
}
@@ -1055,6 +1055,17 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
noteIdsToUpdate.add(ecAttr.noteId);
}
}
+ else if (ecAttr.type === 'label' && ecAttr.name === 'archived') {
+ const note = froca.getNoteFromCache(ecAttr.noteId);
+
+ if (note) {
+ // change of archived status can mean the note should not be displayed in the tree at all
+ // depending on the value of this.hideArchivedNotes
+ for (const parentNote of note.getParentNotes()) {
+ noteIdsToReload.add(parentNote.noteId);
+ }
+ }
+ }
else if (ecAttr.type === 'relation' && ecAttr.name === 'template') {
// missing handling of things inherited from template
noteIdsToReload.add(ecAttr.noteId);