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) => {
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 ) ) ;
You can’t perform that action at this time.
0 commit comments