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