Explorar el Código

fix: workflow run edge status (#3236)

zxhlyh hace 1 año
padre
commit
1384a6d0fd
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      web/app/components/workflow/hooks/use-workflow-run.ts

+ 11 - 0
web/app/components/workflow/hooks/use-workflow-run.ts

@@ -176,6 +176,8 @@ export const useWorkflowRun = () => {
           const {
             getNodes,
             setNodes,
+            edges,
+            setEdges,
           } = store.getState()
           setWorkflowRunningData(produce(workflowRunningData!, (draft) => {
             draft.task_id = task_id
@@ -192,6 +194,15 @@ export const useWorkflowRun = () => {
             })
           })
           setNodes(newNodes)
+          const newEdges = produce(edges, (draft) => {
+            draft.forEach((edge) => {
+              edge.data = {
+                ...edge.data,
+                _runned: false,
+              }
+            })
+          })
+          setEdges(newEdges)
 
           if (onWorkflowStarted)
             onWorkflowStarted(params)