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
feat(in-app-help): update docName attribute if it got changed
Elian Doran61ee15cc01e3
diff --git a/src/services/hidden_subtree.ts b/src/services/hidden_subtree.tsindex bf5af3fa73..d15738e2f5 100644--- a/src/services/hidden_subtree.ts+++ b/src/services/hidden_subtree.ts@@ -458,7 +458,9 @@ function checkHiddenSubtreeRecursively(parentNoteId: string, item: HiddenSubtreefor (const attr of attrs) {const attrId = note.noteId + "_" + attr.type.charAt(0) + attr.name;- if (!note.getAttributes().find((attr) => attr.attributeId === attrId)) {+ const existingAttribute = note.getAttributes().find((attr) => attr.attributeId === attrId);++ if (!existingAttribute) {new BAttribute({attributeId: attrId,noteId: note.noteId,@@ -467,6 +469,10 @@ function checkHiddenSubtreeRecursively(parentNoteId: string, item: HiddenSubtreevalue: attr.value,isInheritable: false}).save();+ } else if (attr.name === "docName") {+ // Updating docname+ existingAttribute.value = attr.value ?? "";+ existingAttribute.save();}}