chat page scroll logic optimization

This commit is contained in:
lhwan 2024-08-30 15:51:57 +08:00
parent 0747835067
commit 7535b69244

View File

@ -72,7 +72,7 @@ const ChatCompletion: React.FC = () => {
setTimeout(() => { setTimeout(() => {
scrollableRef.current?.scrollTo(0, scrollableRef.current?.scrollHeight); scrollableRef.current?.scrollTo(0, scrollableRef.current?.scrollHeight);
}, 50); }, 50);
}, [history, history[history.length - 1].context]]); }, [history, history[history.length - 1].context]);
return ( return (
<div className='flex flex-col w-5/6 mx-auto' ref={scrollableRef}> <div className='flex flex-col w-5/6 mx-auto' ref={scrollableRef}>