Skip to content

Commit fec4793

Browse files
committed
fix(chat): use isExecutingFromChat variable consistently in callbacks
Replace inline overrideTriggerType !== 'chat' checks with !isExecutingFromChat to stay consistent with the rest of the function.
1 parent 72c0f3a commit fec4793

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ export function useWorkflowExecution() {
14961496
// For chat executions, don't set isExecuting=false here — the chat's
14971497
// client-side stream wrapper still has buffered data to deliver.
14981498
// The chat's finally block handles cleanup after the stream is fully consumed.
1499-
if (overrideTriggerType !== 'chat') {
1499+
if (!isExecutingFromChat) {
15001500
setIsExecuting(activeWorkflowId, false)
15011501
setActiveBlocks(activeWorkflowId, new Set())
15021502
}
@@ -1539,7 +1539,7 @@ export function useWorkflowExecution() {
15391539
isPreExecutionError,
15401540
})
15411541

1542-
if (activeWorkflowId && overrideTriggerType !== 'chat') {
1542+
if (activeWorkflowId && !isExecutingFromChat) {
15431543
setIsExecuting(activeWorkflowId, false)
15441544
setIsDebugging(activeWorkflowId, false)
15451545
setActiveBlocks(activeWorkflowId, new Set())
@@ -1565,7 +1565,7 @@ export function useWorkflowExecution() {
15651565
durationMs: data?.duration,
15661566
})
15671567

1568-
if (activeWorkflowId && overrideTriggerType !== 'chat') {
1568+
if (activeWorkflowId && !isExecutingFromChat) {
15691569
setIsExecuting(activeWorkflowId, false)
15701570
setIsDebugging(activeWorkflowId, false)
15711571
setActiveBlocks(activeWorkflowId, new Set())

0 commit comments

Comments
 (0)