【增加】默认选中一个对话

This commit is contained in:
cherishsince 2024-05-17 17:08:09 +08:00
parent fc31528367
commit 1a1e53ae70

View File

@ -134,13 +134,17 @@ const getChatConversationList = async () => {
return b.updateTime - a.updateTime return b.updateTime - a.updateTime
}) })
conversationList.value = res conversationList.value = res
// 3 // 3
if (!activeId?.value) {
await handleConversationClick(res[0].id)
}
// 4
if (conversationList.value.length === 0) { if (conversationList.value.length === 0) {
activeConversationId.value = null activeConversationId.value = null
conversationMap.value = {} conversationMap.value = {}
return return
} }
// 4(30) // 5(30)
conversationMap.value = await conversationTimeGroup(conversationList.value) conversationMap.value = await conversationTimeGroup(conversationList.value)
} }