mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-28 09:03:53 +00:00
fix: optimize tool node check in workflow (#3002)
* fix: optimize tool node check in workflow * comment
This commit is contained in:
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user