|
@@ -109,9 +109,9 @@ const Chat: FC<ChatProps> = ({
|
|
|
const userScrolledRef = useRef(false)
|
|
|
|
|
|
const handleScrollToBottom = useCallback(() => {
|
|
|
- if (chatContainerRef.current && !userScrolledRef.current)
|
|
|
+ if (chatList.length > 1 && chatContainerRef.current && !userScrolledRef.current)
|
|
|
chatContainerRef.current.scrollTop = chatContainerRef.current.scrollHeight
|
|
|
- }, [])
|
|
|
+ }, [chatList.length])
|
|
|
|
|
|
const handleWindowResize = useCallback(() => {
|
|
|
if (chatContainerRef.current)
|