fix(logs): simplify scroll reference by removing length tracking (#7270)

This commit is contained in:
StarsSail
2026-06-18 10:31:38 +00:00
committed by GitHub
parent a528b534b4
commit e5c1c852d7
+2 -8
View File
@@ -61,21 +61,15 @@ const LogPage = () => {
[filterLogs, isDescending],
)
const scrollRef = useRef({ isNearBottom: true, length: 0 })
const scrollRef = useRef({ isNearBottom: true })
const virtuosoRef = useRef<VirtualListHandle>(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) => {