mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
feat(in-app-help): update docName attribute if it got changed
This commit is contained in:
parent
94d53727d1
commit
61ee15cc01
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user