fix: stop but tracing is still loaing and not show current tracing res

This commit is contained in:
Joel
2026-02-09 14:36:57 +08:00
parent f6b036b121
commit 2d6b30f3b8
2 changed files with 27 additions and 11 deletions

View File

@@ -675,6 +675,7 @@ export const useWorkflowRun = () => {
const handleStopRun = useCallback((taskId: string) => {
const setStoppedState = () => {
const {
workflowRunningData,
setWorkflowRunningData,
setIsListening,
setShowVariableInspectPanel,
@@ -682,16 +683,27 @@ export const useWorkflowRun = () => {
setListeningTriggerNodeId,
} = workflowStore.getState()
setWorkflowRunningData({
result: {
status: WorkflowRunningStatus.Stopped,
inputs_truncated: false,
process_data_truncated: false,
outputs_truncated: false,
},
tracing: [],
resultText: '',
})
if (workflowRunningData) {
setWorkflowRunningData({
...workflowRunningData,
result: {
...workflowRunningData.result,
status: WorkflowRunningStatus.Stopped,
},
})
}
else {
setWorkflowRunningData({
result: {
status: WorkflowRunningStatus.Stopped,
inputs_truncated: false,
process_data_truncated: false,
outputs_truncated: false,
},
tracing: [],
resultText: '',
})
}
setIsListening(false)
setListeningTriggerType(null)
setListeningTriggerNodeId(null)

View File

@@ -63,6 +63,10 @@ const WorkflowPreview = () => {
return 'TRACING'
})()
const shouldShowTracingLoading = effectiveTab === 'TRACING'
&& !workflowRunningData?.tracing?.length
&& (workflowRunningData?.result?.status === WorkflowRunningStatus.Running || !workflowRunningData?.result)
const handleTabChange = (tab: string) => {
setUserSelectedTab(tab)
}
@@ -258,7 +262,7 @@ const WorkflowPreview = () => {
/>
)
: null}
{effectiveTab === 'TRACING' && !workflowRunningData?.tracing?.length
{shouldShowTracingLoading
? (
<div className="flex h-full items-center justify-center !bg-background-section-burn">
<Loading />