mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 02:42:59 +00:00 
			
		
		
		
	fix: inability-to-add-node-and-change-the-edge (#7303)
This commit is contained in:
		
							parent
							
								
									2d89b7d0a9
								
							
						
					
					
						commit
						04131f86df
					
				| @ -1,6 +1,7 @@ | |||||||
| import { useCallback } from 'react' | import { useCallback } from 'react' | ||||||
| import produce from 'immer' | import produce from 'immer' | ||||||
| import { v4 as uuid4 } from 'uuid' | import { v4 as uuid4 } from 'uuid' | ||||||
|  | import { useUpdateNodeInternals } from 'reactflow' | ||||||
| import type { | import type { | ||||||
|   Var, |   Var, | ||||||
| } from '../../types' | } from '../../types' | ||||||
| @ -26,6 +27,7 @@ import { | |||||||
| import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use-available-var-list' | import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use-available-var-list' | ||||||
| 
 | 
 | ||||||
| const useConfig = (id: string, payload: IfElseNodeType) => { | const useConfig = (id: string, payload: IfElseNodeType) => { | ||||||
|  |   const updateNodeInternals = useUpdateNodeInternals() | ||||||
|   const { nodesReadOnly: readOnly } = useNodesReadOnly() |   const { nodesReadOnly: readOnly } = useNodesReadOnly() | ||||||
|   const { handleEdgeDeleteByDeleteBranch } = useEdgesInteractions() |   const { handleEdgeDeleteByDeleteBranch } = useEdgesInteractions() | ||||||
|   const { inputs, setInputs } = useNodeCrud<IfElseNodeType>(id, payload) |   const { inputs, setInputs } = useNodeCrud<IfElseNodeType>(id, payload) | ||||||
| @ -108,6 +110,7 @@ const useConfig = (id: string, payload: IfElseNodeType) => { | |||||||
|       ]) |       ]) | ||||||
|     }) |     }) | ||||||
|     setInputs(newInputs) |     setInputs(newInputs) | ||||||
|  |     updateNodeInternals(id) | ||||||
|   }, [inputs, setInputs]) |   }, [inputs, setInputs]) | ||||||
| 
 | 
 | ||||||
|   const handleAddCondition = useCallback<HandleAddCondition>((caseId, valueSelector, varItem) => { |   const handleAddCondition = useCallback<HandleAddCondition>((caseId, valueSelector, varItem) => { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 AIxGEEK
						AIxGEEK