mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:32:50 +00:00
fix: optimize tool node check in workflow (#3002)
* fix: optimize tool node check in workflow * comment
This commit is contained in:
parent
a5b913f1b1
commit
78a85bf847
|
|
@ -352,8 +352,16 @@ export const checkWorkflowNodeAndConnection = ({
|
|||
return [data.nodeId];
|
||||
}
|
||||
|
||||
// check empty node(not edge)
|
||||
const hasEdge = edges.some(
|
||||
// filter tools node edge
|
||||
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
|
||||
);
|
||||
if (!hasEdge) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue