almost flawless
This commit is contained in:
1 file changed
+13
-9
@@ -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 && (
|
||||
|
||||
Reference in new issue
Block a user