almost flawless

This commit is contained in:
7w1 committed 2026-03-19 18:06:12 -05:00
1 parent 0b9993323d
commit afb71b77cc
1 file changed
+13 -9
+13 -9
View File
@@ -274,15 +274,7 @@ export function RoomTimeline({
if (!v) return;
const prev = topSpacerHeightRef.current;
if (eventsLengthRef.current > 15) {
if (prev > 0) {
topSpacerHeightRef.current = 0;
setTopSpacerHeight(0);
}
return;
}
const newH = Math.max(0, v.viewportSize + prev - v.scrollSize);
const newH = Math.max(0, v.viewportSize - v.scrollSize + prev);
if (Math.abs(prev - newH) > 2) {
topSpacerHeightRef.current = newH;
setTopSpacerHeight(newH);
@@ -612,6 +604,18 @@ export function RoomTimeline({
hideMemberInReadOnly,
});
useEffect(() => {
const v = vListRef.current;
if (!v) return;
if (
canPaginateBackRef.current &&
backwardStatusRef.current === 'idle' &&
v.scrollSize <= v.viewportSize
) {
timelineSyncRef.current.handleTimelinePagination(true);
}
}, [timelineSync.eventsLength, timelineSync.backwardStatus]);
return (
<Box grow="Yes" style={{ position: 'relative' }}>
{unreadInfo?.readUptoEventId && !unreadInfo?.inLiveTimeline && (