From fecfe3d02499ae17d7ec9793462ce61789b12154 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 11 Mar 2026 16:54:03 -0500 Subject: [PATCH] delete the manual math and hope it works? --- src/app/features/room/RoomTimeline.tsx | 55 ++++++++++++-------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 355bfe36..dadd2f24 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -2184,16 +2184,22 @@ export function RoomTimeline({ ); } else { backPaginationJSX = ( - + +
{backwardStatus === 'loading' && ( - + )} -
); } @@ -2257,37 +2263,26 @@ export function RoomTimeline({ ); } else { frontPaginationJSX = ( - <> -
+ +
{forwardStatus === 'loading' && ( - + )} - + ); } } - const lastScrollHeight = useRef(0); - - useLayoutEffect(() => { - const scrollEl = scrollRef.current; - if (!scrollEl) return; - - if (backwardStatus === 'loading') { - lastScrollHeight.current = scrollEl.scrollHeight; - } - - if (backwardStatus === 'idle' && lastScrollHeight.current > 0) { - const newScrollHeight = scrollEl.scrollHeight; - const heightDifference = newScrollHeight - lastScrollHeight.current; - - if (heightDifference > 0) { - scrollEl.scrollTop += heightDifference; - } - lastScrollHeight.current = 0; - } - }, [backwardStatus, processedEvents.length]); return (