From c142d6ff3a6f8b270913ac5fb9b241ca4fd8c5c0 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Fri, 20 Dec 2024 14:29:19 -0500 Subject: [PATCH] remove latestmessageref --- frontend/app/view/waveai/waveai.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/app/view/waveai/waveai.tsx b/frontend/app/view/waveai/waveai.tsx index f4edd27a2..e3c131759 100644 --- a/frontend/app/view/waveai/waveai.tsx +++ b/frontend/app/view/waveai/waveai.tsx @@ -513,7 +513,6 @@ const ChatWindow = memo( const osRef = useRef(null); const prevMessagesLenRef = useRef(messages.length); - const latestMessageRef = useRef(null); useImperativeHandle(ref, () => osRef.current as OverlayScrollbarsComponentRef); @@ -523,7 +522,6 @@ const ChatWindow = memo( const { viewport } = osRef.current.osInstance().elements(); const curMessagesLen = messages.length; if (prevMessagesLenRef.current !== curMessagesLen || !isUserScrolling) { - latestMessageRef.current = messages[curMessagesLen - 1]; viewport.scrollTo({ behavior: "auto", top: chatWindowRef.current?.scrollHeight || 0,