mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: Chat page retains the display of the last conversation
This commit is contained in:
parent
9249c1756f
commit
b917b72fe6
|
|
@ -201,6 +201,13 @@ function getChatLog(id: string) {
|
|||
|
||||
log.asyncGetChatLogClient(id, page, left_loading).then((res: any) => {
|
||||
chatLogData.value = res.data.records
|
||||
paginationConfig.current_page = 1
|
||||
paginationConfig.total = 0
|
||||
currentRecordList.value = []
|
||||
currentChatId.value = chatLogData.value?.[0]?.id || 'new'
|
||||
if (currentChatId.value !== 'new') {
|
||||
getChatRecord()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,16 @@ function getChatLog(id: string, refresh?: boolean) {
|
|||
log.asyncGetChatLogClient(id, page, left_loading).then((res: any) => {
|
||||
chatLogData.value = res.data.records
|
||||
if (refresh) {
|
||||
currentChatName.value = chatLogData.value?.[0].abstract
|
||||
currentChatName.value = chatLogData.value?.[0]?.abstract
|
||||
} else {
|
||||
paginationConfig.value.current_page = 1
|
||||
paginationConfig.value.total = 0
|
||||
currentRecordList.value = []
|
||||
currentChatId.value = chatLogData.value?.[0]?.id || 'new'
|
||||
currentChatName.value = chatLogData.value?.[0]?.abstract || t('chat.createChat')
|
||||
if (currentChatId.value !== 'new') {
|
||||
getChatRecord()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue