fix: 🐛 fix delete node connection not delete (#1167)
Co-authored-by: 橙林 <chenglin@dian.so>
This commit is contained in:
@ -314,6 +314,12 @@ class ExperimentGraph extends GraphCore<BaseNode, BaseEdge> {
|
||||
nextGraph.nodes = oldGraph.nodes.filter(
|
||||
(node) => !nodes.includes(node.id.toString()),
|
||||
)
|
||||
nextGraph.links = oldGraph.links.filter(
|
||||
(link) =>
|
||||
!nodes.find((node) =>
|
||||
[link.source.toString(), link.target.toString()].includes(node),
|
||||
),
|
||||
)
|
||||
} else {
|
||||
nextGraph.links = oldGraph.links.filter((link) => {
|
||||
return !links.find((delLink) => {
|
||||
|
Reference in New Issue
Block a user