fix: workflow route

This commit is contained in:
StyleZhang
2024-03-04 14:53:48 +08:00
parent ac40eb8d87
commit bd205f63cc
6 changed files with 17 additions and 15 deletions

View File

@ -55,11 +55,14 @@ export const useWorkflow = () => {
} = store.getState()
e.stopPropagation()
const newNodes = produce(getNodes(), (draft) => {
const nodes = getNodes()
const newNodes = produce(nodes, (draft) => {
const currentNode = draft.find(n => n.id === node.id)!
currentNode.position = node.position
})
setNodes(newNodes)
}, [store])

View File

@ -47,8 +47,6 @@ const Workflow: FC<WorkflowProps> = memo(({
const [edges, _, onEdgesChange] = useEdgesState(initialEdges)
// const nodesInitialized = useNodesInitialized()
console.log(nodes)
const {
// handleLayout,