Skip to content

Commit 72d6047

Browse files
author
wuayee
committed
[appBuilder] 增加"刷新页面后,可以继续停止对话"的功能
1 parent 5c90521 commit 72d6047

File tree

1 file changed

+12
-0
lines changed
  • app-engine/frontend/src/pages/chatPreview

1 file changed

+12
-0
lines changed

app-engine/frontend/src/pages/chatPreview/index.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ const ChatPreview = (props) => {
160160
try {
161161
const res:any = await getChatRecentLog(tenantId, chatId, appId);
162162
if (res.data && res.data.length) {
163+
showTerminate(res);
163164
let chatArr = historyChatProcess(res);
164165
listRef.current = deepClone(chatArr);
165166
await dispatch(setChatList(chatArr));
@@ -170,6 +171,17 @@ const ChatPreview = (props) => {
170171
setLoading(false);
171172
}
172173
}
174+
175+
const showTerminate = (res) => {
176+
const lastItem = res.data[res.data.length - 1];
177+
if (lastItem && lastItem.status === 'RUNNING') {
178+
setShowStop(true);
179+
dispatch(setChatRunning(true));
180+
runningInstanceId.current = lastItem.instanceId;
181+
}
182+
return;
183+
};
184+
173185
useEffect(() => {
174186
if (appInfo.id) {
175187
dispatch(setChatRunning(false));

0 commit comments

Comments
 (0)