[fix] Fix link deletion from middle button when connected to reroute nodes deletes wrong link (#4928)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Christian Byrne
2025-08-11 19:26:37 -07:00
committed by GitHub
parent c7baf3c340
commit 7972550f6b
4 changed files with 294 additions and 2 deletions

View File

@@ -6234,9 +6234,17 @@ export class LGraphCanvas
break
}
case 'Delete':
graph.removeLink(segment.id)
case 'Delete': {
// segment can be a Reroute object, in which case segment.id is the reroute id
const linkId =
segment instanceof Reroute
? segment.linkIds.values().next().value
: segment.id
if (linkId !== undefined) {
graph.removeLink(linkId)
}
break
}
default:
}
}