Fix node rename and link coherence

This commit is contained in:
barsdeveloper
2024-10-16 22:02:31 +02:00
parent a8d78483d5
commit 2352d866a6
6 changed files with 20 additions and 16 deletions

View File

@@ -100,7 +100,7 @@ export default class NodeElement extends ISelectableDraggableElement {
}
/** @param {String} name */
#redirectLinksAfterRename(name) {
#redirectLinksBeforeRename(name) {
for (let sourcePinElement of this.getPinElements()) {
for (let targetPinReference of sourcePinElement.getLinks()) {
this.blueprint.getPin(targetPinReference).redirectLink(
@@ -135,9 +135,9 @@ export default class NodeElement extends ISelectableDraggableElement {
"Name",
/** @param {InstanceType<typeof ObjectEntity.attributes.Name>} newName */
newName => {
this.#redirectLinksBeforeRename(newName.value)
this.nodeTitle = newName.value
this.nodeDisplayName = nodeTitle(entity)
this.#redirectLinksAfterRename(newName.value)
}
)
}