File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,13 @@ function getChatLog(id: string) {
201201
202202 log .asyncGetChatLogClient (id , page , left_loading ).then ((res : any ) => {
203203 chatLogData .value = res .data .records
204+ paginationConfig .current_page = 1
205+ paginationConfig .total = 0
206+ currentRecordList .value = []
207+ currentChatId .value = chatLogData .value ?.[0 ]?.id || ' new'
208+ if (currentChatId .value !== ' new' ) {
209+ getChatRecord ()
210+ }
204211 })
205212}
206213
Original file line number Diff line number Diff line change @@ -270,7 +270,16 @@ function getChatLog(id: string, refresh?: boolean) {
270270 log .asyncGetChatLogClient (id , page , left_loading ).then ((res : any ) => {
271271 chatLogData .value = res .data .records
272272 if (refresh ) {
273- currentChatName .value = chatLogData .value ?.[0 ].abstract
273+ currentChatName .value = chatLogData .value ?.[0 ]?.abstract
274+ } else {
275+ paginationConfig .value .current_page = 1
276+ paginationConfig .value .total = 0
277+ currentRecordList .value = []
278+ currentChatId .value = chatLogData .value ?.[0 ]?.id || ' new'
279+ currentChatName .value = chatLogData .value ?.[0 ]?.abstract || t (' chat.createChat' )
280+ if (currentChatId .value !== ' new' ) {
281+ getChatRecord ()
282+ }
274283 }
275284 })
276285}
You can’t perform that action at this time.
0 commit comments