mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-21 03:35:36 +00:00
fix has tool node condition (#4907)
This commit is contained in:
@@ -19,7 +19,7 @@ export const useNodeTemplates = () => {
|
||||
const nodeList = useContextSelector(WorkflowContext, (v) => v.nodeList);
|
||||
|
||||
const hasToolNode = useMemo(
|
||||
() => nodeList.some((node) => node.flowNodeType === FlowNodeTypeEnum.toolSet),
|
||||
() => nodeList.some((node) => node.flowNodeType === FlowNodeTypeEnum.tools),
|
||||
[nodeList]
|
||||
);
|
||||
|
||||
|
@@ -105,7 +105,6 @@ type WorkflowContextType = {
|
||||
|
||||
// nodes
|
||||
nodeList: FlowNodeItemType[];
|
||||
hasToolNode: boolean;
|
||||
|
||||
onUpdateNodeError: (node: string, isError: Boolean) => void;
|
||||
onResetNode: (e: { id: string; node: FlowNodeTemplateType }) => void;
|
||||
@@ -226,7 +225,6 @@ export const WorkflowContext = createContext<WorkflowContextType>({
|
||||
},
|
||||
basicNodeTemplates: [],
|
||||
nodeList: [],
|
||||
hasToolNode: false,
|
||||
onUpdateNodeError: function (node: string, isError: Boolean): void {
|
||||
throw new Error('Function not implemented.');
|
||||
},
|
||||
@@ -399,10 +397,6 @@ const WorkflowContextProvider = ({
|
||||
[nodeListString]
|
||||
);
|
||||
|
||||
const hasToolNode = useMemo(() => {
|
||||
return !!nodeList.find((node) => node.flowNodeType === FlowNodeTypeEnum.tools);
|
||||
}, [nodeList]);
|
||||
|
||||
const onUpdateNodeError = useMemoizedFn((nodeId: string, isError: Boolean) => {
|
||||
setNodes((state) => {
|
||||
return state.map((item) => {
|
||||
@@ -1011,7 +1005,6 @@ const WorkflowContextProvider = ({
|
||||
|
||||
// node
|
||||
nodeList,
|
||||
hasToolNode,
|
||||
onUpdateNodeError,
|
||||
onResetNode,
|
||||
onChangeNode,
|
||||
@@ -1057,7 +1050,6 @@ const WorkflowContextProvider = ({
|
||||
flowData2StoreDataAndCheck,
|
||||
future,
|
||||
getNodeDynamicInputs,
|
||||
hasToolNode,
|
||||
initData,
|
||||
nodeList,
|
||||
onChangeNode,
|
||||
|
Reference in New Issue
Block a user