feat(in-app-help): update docName attribute if it got changed

This commit is contained in:
Elian Doran 2025-02-02 15:32:28 +02:00
parent 94d53727d1
commit 61ee15cc01
No known key found for this signature in database

View File

@ -458,7 +458,9 @@ function checkHiddenSubtreeRecursively(parentNoteId: string, item: HiddenSubtree
for (const attr of attrs) { for (const attr of attrs) {
const attrId = note.noteId + "_" + attr.type.charAt(0) + attr.name; 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({ new BAttribute({
attributeId: attrId, attributeId: attrId,
noteId: note.noteId, noteId: note.noteId,
@ -467,6 +469,10 @@ function checkHiddenSubtreeRecursively(parentNoteId: string, item: HiddenSubtree
value: attr.value, value: attr.value,
isInheritable: false isInheritable: false
}).save(); }).save();
} else if (attr.name === "docName") {
// Updating docname
existingAttribute.value = attr.value ?? "";
existingAttribute.save();
} }
} }