From af0e6481f83fb62b220eb266a6ec2742957172de Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 1 Oct 2023 21:57:12 +0100 Subject: [PATCH] Update Conversation.tsx --- frontend/src/conversation/Conversation.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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({