Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(log list): prevent duplicate data fetch (#9190)

-LAN-a34891851bd3
diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx
index 149e877fa4a..7dff48c20a2 100644
--- a/web/app/components/app/log/list.tsx
+++ b/web/app/components/app/log/list.tsx
@@ -299,10 +299,14 @@ function DetailPanel<T extends ChatConversationFullDetailResponse | CompletionCo
}))
}, [items])
+ const fetchInitiated = useRef(false)
+
useEffect(() => {
- if (appDetail?.id && detail.id && appDetail?.mode !== 'completion')
+ if (appDetail?.id && detail.id && appDetail?.mode !== 'completion' && !fetchInitiated.current) {
+ fetchInitiated.current = true
fetchData()
- }, [appDetail?.id, detail.id, appDetail?.mode])
+ }
+ }, [appDetail?.id, detail.id, appDetail?.mode, fetchData])
const isChatMode = appDetail?.mode !== 'completion'
const isAdvanced = appDetail?.mode === 'advanced-chat'