From e5c1c852d7ad58244b4222fc279ff854c684f60f Mon Sep 17 00:00:00 2001 From: StarsSail <152023695+wysha-object@users.noreply.github.com> Date: Thu, 18 Jun 2026 18:31:38 +0800 Subject: [PATCH] fix(logs): simplify scroll reference by removing length tracking (#7270) --- src/pages/logs.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pages/logs.tsx b/src/pages/logs.tsx index 46e6fd0c6..99ff285c8 100644 --- a/src/pages/logs.tsx +++ b/src/pages/logs.tsx @@ -61,21 +61,15 @@ const LogPage = () => { [filterLogs, isDescending], ) - const scrollRef = useRef({ isNearBottom: true, length: 0 }) + const scrollRef = useRef({ isNearBottom: true }) const virtuosoRef = useRef(null) useEffect(() => { - if ( - !isDescending && - filteredLogs.length > scrollRef.current.length && - scrollRef.current.isNearBottom - ) { + if (!isDescending && scrollRef.current.isNearBottom) { virtuosoRef.current?.scrollToIndex(filteredLogs.length - 1, { behavior: 'smooth', }) } - - scrollRef.current.length = filteredLogs.length }, [isDescending, filteredLogs.length]) const handleLogLevelChange = (newLevel: LogFilter) => {