fix: auto-select first conversation + remove chat avatars
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
This commit is contained in:
parent
ecd414fab0
commit
fae5d36b0c
@ -41,6 +41,13 @@ function ChatPage() {
|
|||||||
try { setConversations(await listConversations()) } catch { /* */ }
|
try { setConversations(await listConversations()) } catch { /* */ }
|
||||||
}, [])
|
}, [])
|
||||||
useEffect(() => { loadConversations() }, [loadConversations])
|
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])
|
useEffect(() => { messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }) }, [messages])
|
||||||
|
|
||||||
const switchConversation = useCallback(async (id: string) => {
|
const switchConversation = useCallback(async (id: string) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user