fix: auto-select first conversation + remove chat avatars
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s

This commit is contained in:
WangDL 2026-05-22 16:23:26 +08:00
parent ecd414fab0
commit fae5d36b0c

View File

@ -41,6 +41,13 @@ function ChatPage() {
try { setConversations(await listConversations()) } catch { /* */ }
}, [])
useEffect(() => { loadConversations() }, [loadConversations])
// Auto-select first conversation on load
useEffect(() => {
if (!activeId && conversations.length > 0) {
switchConversation(conversations[0].id)
}
}, [conversations, activeId])
useEffect(() => { messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }) }, [messages])
const switchConversation = useCallback(async (id: string) => {