From 04131f86df4cc8261125e06b44f3a66cb5428c9f Mon Sep 17 00:00:00 2001 From: AIxGEEK Date: Thu, 15 Aug 2024 17:26:11 +0800 Subject: [PATCH] fix: inability-to-add-node-and-change-the-edge (#7303) --- web/app/components/workflow/nodes/if-else/use-config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/app/components/workflow/nodes/if-else/use-config.ts b/web/app/components/workflow/nodes/if-else/use-config.ts index d3e2785986..2dc680b0af 100644 --- a/web/app/components/workflow/nodes/if-else/use-config.ts +++ b/web/app/components/workflow/nodes/if-else/use-config.ts @@ -1,6 +1,7 @@ import { useCallback } from 'react' import produce from 'immer' import { v4 as uuid4 } from 'uuid' +import { useUpdateNodeInternals } from 'reactflow' import type { Var, } from '../../types' @@ -26,6 +27,7 @@ import { import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use-available-var-list' const useConfig = (id: string, payload: IfElseNodeType) => { + const updateNodeInternals = useUpdateNodeInternals() const { nodesReadOnly: readOnly } = useNodesReadOnly() const { handleEdgeDeleteByDeleteBranch } = useEdgesInteractions() const { inputs, setInputs } = useNodeCrud(id, payload) @@ -108,6 +110,7 @@ const useConfig = (id: string, payload: IfElseNodeType) => { ]) }) setInputs(newInputs) + updateNodeInternals(id) }, [inputs, setInputs]) const handleAddCondition = useCallback((caseId, valueSelector, varItem) => {