File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
app-engine/frontend/src/pages/chatPreview Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ const ChatPreview = (props) => {
160
160
try {
161
161
const res :any = await getChatRecentLog ( tenantId , chatId , appId ) ;
162
162
if ( res . data && res . data . length ) {
163
+ showTerminate ( res ) ;
163
164
let chatArr = historyChatProcess ( res ) ;
164
165
listRef . current = deepClone ( chatArr ) ;
165
166
await dispatch ( setChatList ( chatArr ) ) ;
@@ -170,6 +171,17 @@ const ChatPreview = (props) => {
170
171
setLoading ( false ) ;
171
172
}
172
173
}
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
+
173
185
useEffect ( ( ) => {
174
186
if ( appInfo . id ) {
175
187
dispatch ( setChatRunning ( false ) ) ;
You can’t perform that action at this time.
0 commit comments