From ba7faf74f61fb21a2f8196058e565170ca0ab8fc Mon Sep 17 00:00:00 2001 From: wuayee Date: Wed, 18 Jun 2025 10:45:04 +0800 Subject: [PATCH] =?UTF-8?q?[appBuilder]=20=E5=A2=9E=E5=8A=A0"=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=A1=B5=E9=9D=A2=E5=90=8E=EF=BC=8C=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E5=81=9C=E6=AD=A2=E5=AF=B9=E8=AF=9D"?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app-engine/frontend/src/pages/chatPreview/index.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app-engine/frontend/src/pages/chatPreview/index.tsx b/app-engine/frontend/src/pages/chatPreview/index.tsx index cacc8a83c..2f3caa80e 100644 --- a/app-engine/frontend/src/pages/chatPreview/index.tsx +++ b/app-engine/frontend/src/pages/chatPreview/index.tsx @@ -160,6 +160,7 @@ const ChatPreview = (props) => { try { const res:any = await getChatRecentLog(tenantId, chatId, appId); if (res.data && res.data.length) { + showTerminate(res); let chatArr = historyChatProcess(res); listRef.current = deepClone(chatArr); await dispatch(setChatList(chatArr)); @@ -170,6 +171,17 @@ const ChatPreview = (props) => { setLoading(false); } } + + const showTerminate = (res) => { + const lastItem = res.data[res.data.length - 1]; + if (lastItem && lastItem.status === 'RUNNING') { + setShowStop(true); + dispatch(setChatRunning(true)); + runningInstanceId.current = lastItem.instanceId; + } + return; + }; + useEffect(() => { if (appInfo.id) { dispatch(setChatRunning(false));