From 13a4dca30553def4db425fbde095d7972d642f18 Mon Sep 17 00:00:00 2001 From: Steven Roussey Date: Thu, 11 Apr 2024 09:16:30 -0700 Subject: [PATCH] [web] fix: post merge cleanup --- packages/web/src/RunGraphFlow.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/web/src/RunGraphFlow.tsx b/packages/web/src/RunGraphFlow.tsx index 80e00df..5170d1f 100644 --- a/packages/web/src/RunGraphFlow.tsx +++ b/packages/web/src/RunGraphFlow.tsx @@ -133,7 +133,6 @@ function doNodeLayout( function listenToTask( task: Task, setNodes: Dispatch[]>>, - edges: Edge[], setEdges: Dispatch> ) { task.on("progress", (progress, progressText) => { @@ -209,7 +208,7 @@ function listenToTask( ); }); if (task.isCompound) { - listenToGraphTasks(task.subGraph, setNodes, edges, setEdges); + listenToGraphTasks(task.subGraph, setNodes, setEdges); task.on("regenerate", () => { // console.log("Node regenerated", task.config.id); setNodes((nodes: Node[]) => { @@ -223,7 +222,7 @@ function listenToTask( connectable: false, }) as Node ); - listenToGraphTasks(task.subGraph, setNodes, edges, setEdges); + listenToGraphTasks(task.subGraph, setNodes, setEdges); let returnNodes = nodes.filter((n) => n.parentId !== task.config.id); // remove old children returnNodes = [...returnNodes, ...children]; // add new children returnNodes = sortNodes(returnNodes); // sort all nodes (parent, children, parent, children, ...) @@ -236,12 +235,11 @@ function listenToTask( function listenToGraphTasks( graph: TaskGraph, setNodes: Dispatch[]>>, - edges: Edge[], setEdges: Dispatch> ) { const nodes = graph.getNodes(); for (const node of nodes) { - listenToTask(node, setNodes, edges, setEdges); + listenToTask(node, setNodes, setEdges); } } @@ -303,7 +301,7 @@ export const RunGraphFlow: React.FC<{ }; }) ); - listenToGraphTasks(graph, setNodes, edges, setEdges); + listenToGraphTasks(graph, setNodes, setEdges); } }, [graph, setNodes, setEdges, graphRef.current]);