chore(core): cleanup EdgeWrapper
This commit is contained in:
@@ -44,7 +44,6 @@ const EdgeWrapper = defineComponent({
|
|||||||
findNode,
|
findNode,
|
||||||
isValidConnection,
|
isValidConnection,
|
||||||
multiSelectionActive,
|
multiSelectionActive,
|
||||||
hooks: flowHooks,
|
|
||||||
} = useVueFlow()
|
} = useVueFlow()
|
||||||
|
|
||||||
const hooks = useEdgeHooks(props.edge, emits)
|
const hooks = useEdgeHooks(props.edge, emits)
|
||||||
@@ -84,21 +83,19 @@ const EdgeWrapper = defineComponent({
|
|||||||
const targetNode = findNode(edge.value.target)
|
const targetNode = findNode(edge.value.target)
|
||||||
|
|
||||||
if (!sourceNode && !targetNode) {
|
if (!sourceNode && !targetNode) {
|
||||||
flowHooks.value.error.trigger(
|
emits.error(new VueFlowError(ErrorCode.EDGE_SOURCE_TARGET_MISSING, edge.value.id, edge.value.source, edge.value.target))
|
||||||
new VueFlowError(ErrorCode.EDGE_SOURCE_TARGET_MISSING, edge.value.id, edge.value.source, edge.value.target),
|
|
||||||
)
|
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sourceNode) {
|
if (!sourceNode) {
|
||||||
flowHooks.value.error.trigger(new VueFlowError(ErrorCode.EDGE_SOURCE_MISSING, edge.value.id, edge.value.source))
|
emits.error(new VueFlowError(ErrorCode.EDGE_SOURCE_MISSING, edge.value.id, edge.value.source))
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!targetNode) {
|
if (!targetNode) {
|
||||||
flowHooks.value.error.trigger(new VueFlowError(ErrorCode.EDGE_TARGET_MISSING, edge.value.id, edge.value.target))
|
emits.error(new VueFlowError(ErrorCode.EDGE_TARGET_MISSING, edge.value.id, edge.value.target))
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user