mirror of
https://github.com/arc53/DocsGPT
synced 2024-11-02 03:40:17 +00:00
commit
b5cb3f994b
@ -19,8 +19,9 @@ export default function Conversation() {
|
|||||||
const endMessageRef = useRef<HTMLDivElement>(null);
|
const endMessageRef = useRef<HTMLDivElement>(null);
|
||||||
const inputRef = useRef<HTMLDivElement>(null);
|
const inputRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(
|
||||||
endMessageRef?.current?.scrollIntoView({ behavior: 'smooth' }),
|
() => endMessageRef?.current?.scrollIntoView({ behavior: 'smooth' }),
|
||||||
|
[messages],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleQuestion = (question: string) => {
|
const handleQuestion = (question: string) => {
|
||||||
@ -35,7 +36,7 @@ export default function Conversation() {
|
|||||||
return (
|
return (
|
||||||
<ConversationBubble
|
<ConversationBubble
|
||||||
ref={index === messages.length - 1 ? endMessageRef : null}
|
ref={index === messages.length - 1 ? endMessageRef : null}
|
||||||
className={`${index === messages.length - 1 ? 'mb-20' : 'mb-7'}`}
|
className={`${index === messages.length - 1 ? 'mb-24' : 'mb-7'}`}
|
||||||
key={index}
|
key={index}
|
||||||
message={message.text}
|
message={message.text}
|
||||||
type={message.type}
|
type={message.type}
|
||||||
|
Loading…
Reference in New Issue
Block a user