File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -382,10 +382,13 @@ const WorkflowNodeRow = memo(function WorkflowNodeRow({
382382 ( ) => Boolean ( entry . error ) || hasErrorInTree ( children ) ,
383383 [ entry . error , children ]
384384 )
385- const hasRunningDescendant = useMemo ( ( ) => hasRunningInTree ( children ) , [ children ] )
385+ const hasRunningDescendant = useMemo (
386+ ( ) => Boolean ( entry . isRunning ) || hasRunningInTree ( children ) ,
387+ [ entry . isRunning , children ]
388+ )
386389 const hasCanceledDescendant = useMemo (
387- ( ) => hasCanceledInTree ( children ) && ! hasRunningDescendant ,
388- [ children , hasRunningDescendant ]
390+ ( ) => ( Boolean ( entry . isCanceled ) || hasCanceledInTree ( children ) ) && ! hasRunningDescendant ,
391+ [ entry . isCanceled , children , hasRunningDescendant ]
389392 )
390393
391394 return (
Original file line number Diff line number Diff line change @@ -199,13 +199,16 @@ interface IterationGroup {
199199 */
200200function collectWorkflowDescendants (
201201 workflowBlockId : string ,
202- workflowChildGroups : Map < string , ConsoleEntry [ ] >
202+ workflowChildGroups : Map < string , ConsoleEntry [ ] > ,
203+ visited : Set < string > = new Set ( )
203204) : ConsoleEntry [ ] {
205+ if ( visited . has ( workflowBlockId ) ) return [ ]
206+ visited . add ( workflowBlockId )
204207 const direct = workflowChildGroups . get ( workflowBlockId ) ?? [ ]
205208 const result = [ ...direct ]
206209 for ( const entry of direct ) {
207210 if ( isWorkflowBlockType ( entry . blockType ) ) {
208- result . push ( ...collectWorkflowDescendants ( entry . blockId , workflowChildGroups ) )
211+ result . push ( ...collectWorkflowDescendants ( entry . blockId , workflowChildGroups , visited ) )
209212 }
210213 }
211214 return result
You can’t perform that action at this time.
0 commit comments