diff --git a/app/ConversationFrontend.tsx b/app/ConversationFrontend.tsx index b6bd312..d268bfb 100644 --- a/app/ConversationFrontend.tsx +++ b/app/ConversationFrontend.tsx @@ -1,4 +1,4 @@ -import React, { ForwardedRef, useEffect, useRef } from 'react'; +import React, { ForwardedRef } from 'react'; interface ConversationProps { messages: string[]; @@ -9,32 +9,22 @@ interface ConversationProps { const ConversationFrontend = React.forwardRef( ({ messages, onResendClick, onEditClick, onCopyClick }, ref: ForwardedRef) => { - const endOfMessagesRef = useRef(null); - - // Auto-scroll to the bottom of the conversation whenever a new message is added - useEffect(() => { - if (endOfMessagesRef.current) { - endOfMessagesRef.current.scrollIntoView({ behavior: 'smooth' }); - } - }, [messages]); // Triggers the effect whenever the 'messages' array changes - return (
{messages.map((message, index) => { const isUserMessage = message.startsWith('User:'); - console.log("output: "+messages) return (
-

{message}

+

+ {message} +

); })} - {/* Dummy div to mark the end of the conversation for auto-scrolling */} -