Commit 1a1e53ae by cherishsince

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

parent fc315283
...@@ -134,13 +134,17 @@ const getChatConversationList = async () => { ...@@ -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)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment