【优化】AI 对话,处理id 为空,对话不存在情况

pull/453/head
cherishsince 2024-05-21 16:21:14 +08:00
parent 15e7a260bf
commit 24ead9f09b
1 changed files with 8 additions and 3 deletions

View File

@ -191,8 +191,11 @@ const textRoll = async () => {
// ============ ============== // ============ ==============
function scrollToBottom(isIgnore?: boolean) { function scrollToBottom(isIgnore?: boolean) {
// isIgnore = isIgnore !== null ? isIgnore : false
nextTick(() => { nextTick(() => {
if (messageRef.value) {
messageRef.value.scrollToBottom(isIgnore) messageRef.value.scrollToBottom(isIgnore)
}
}) })
} }
@ -441,9 +444,11 @@ const getConversation = async (id: string | null) => {
return return
} }
const conversation: ChatConversationVO = await ChatConversationApi.getChatConversationMy(id) const conversation: ChatConversationVO = await ChatConversationApi.getChatConversationMy(id)
if (conversation) {
activeConversation.value = conversation activeConversation.value = conversation
activeConversationId.value = conversation.id activeConversationId.value = conversation.id
} }
}
// ============ message =========== // ============ message ===========