diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 69a80ac3..b110ec19 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -23,7 +23,7 @@ export default function Conversation() { const endMessageRef = useRef(null); const inputRef = useRef(null); - const [hasScrolledToLast, setHasScrolledToLast] = useState(false); + const [hasScrolledToLast, setHasScrolledToLast] = useState(true); useEffect(() => { scrollIntoView(); @@ -51,7 +51,7 @@ export default function Conversation() { return () => { observer.disconnect(); }; - }, []); + }, [endMessageRef.current]); const scrollIntoView = () => { endMessageRef?.current?.scrollIntoView({