Commit 78a85bf8 by heheer Committed by GitHub

fix: optimize tool node check in workflow (#3002)

* fix: optimize tool node check in workflow

* comment
parent a5b913f1
...@@ -352,8 +352,16 @@ export const checkWorkflowNodeAndConnection = ({ ...@@ -352,8 +352,16 @@ export const checkWorkflowNodeAndConnection = ({
return [data.nodeId]; return [data.nodeId];
} }
// check empty node(not edge) // filter tools node edge
const hasEdge = edges.some( const edgeFilted = edges.filter(
(edge) =>
!(
data.flowNodeType === FlowNodeTypeEnum.tools &&
edge.sourceHandle === NodeOutputKeyEnum.selectedTools
)
);
// check node has edge
const hasEdge = edgeFilted.some(
(edge) => edge.source === data.nodeId || edge.target === data.nodeId (edge) => edge.source === data.nodeId || edge.target === data.nodeId
); );
if (!hasEdge) { if (!hasEdge) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment