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

This commit is contained in:
cherishsince 2024-05-21 16:21:14 +08:00
parent 15e7a260bf
commit 24ead9f09b

View File

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