Skip to content

Commit

Permalink
Update Conversation.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
dartpain committed Oct 1, 2023
1 parent 153b5c0 commit af0e648
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Conversation() {
const endMessageRef = useRef<HTMLDivElement>(null);
const inputRef = useRef<HTMLDivElement>(null);

const [hasScrolledToLast, setHasScrolledToLast] = useState(false);
const [hasScrolledToLast, setHasScrolledToLast] = useState(true);

useEffect(() => {
scrollIntoView();
Expand Down Expand Up @@ -51,7 +51,7 @@ export default function Conversation() {
return () => {
observer.disconnect();
};
}, []);
}, [endMessageRef.current]);

const scrollIntoView = () => {
endMessageRef?.current?.scrollIntoView({
Expand Down

0 comments on commit af0e648

Please sign in to comment.