fix has tool node condition (#4907)

This commit is contained in:
heheer
2025-05-28 10:34:02 +08:00
committed by GitHub
parent 50d235c42a
commit 331b851a78
2 changed files with 1 additions and 9 deletions

View File

@@ -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]
);

View File

@@ -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,