@@ -74,7 +74,7 @@ import { useStreamCleanup } from '@/hooks/use-stream-cleanup'
7474import { useCanvasModeStore } from '@/stores/canvas-mode'
7575import { useChatStore } from '@/stores/chat/store'
7676import { useCopilotTrainingStore } from '@/stores/copilot-training/store'
77- import { useCurrentWorkflowExecution , useExecutionStore } from '@/stores/execution'
77+ import { defaultWorkflowExecutionState , useExecutionStore } from '@/stores/execution'
7878import { useSearchModalStore } from '@/stores/modals/search/store'
7979import { useNotificationStore } from '@/stores/notifications'
8080import { useCopilotStore , usePanelEditorStore } from '@/stores/panel'
@@ -740,7 +740,17 @@ const WorkflowContent = React.memo(() => {
740740 [ collaborativeBatchAddBlocks , setSelectedEdges , setPendingSelection ]
741741 )
742742
743- const { activeBlockIds, pendingBlocks, isDebugging, isExecuting } = useCurrentWorkflowExecution ( )
743+ const { activeBlockIds, pendingBlocks, isDebugging, isExecuting } = useExecutionStore (
744+ useShallow ( ( state ) => {
745+ const wf = activeWorkflowId ? state . workflowExecutions . get ( activeWorkflowId ) : undefined
746+ return {
747+ activeBlockIds : wf ?. activeBlockIds ?? defaultWorkflowExecutionState . activeBlockIds ,
748+ pendingBlocks : wf ?. pendingBlocks ?? defaultWorkflowExecutionState . pendingBlocks ,
749+ isDebugging : wf ?. isDebugging ?? false ,
750+ isExecuting : wf ?. isExecuting ?? false ,
751+ }
752+ } )
753+ )
744754 const getLastExecutionSnapshot = useExecutionStore ( ( s ) => s . getLastExecutionSnapshot )
745755
746756 const [ dragStartParentId , setDragStartParentId ] = useState < string | null > ( null )
0 commit comments