mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
Infinite Scroll: Attempt to fix a weird bug with missing chats
This commit is contained in:
parent
0bc2d2b021
commit
a49b02e291
@ -140,7 +140,7 @@ const InfiniteScroll: FC<OwnProps> = ({
|
||||
const nextAnchor = listItemElements[0];
|
||||
if (nextAnchor) {
|
||||
const nextAnchorTop = nextAnchor.getBoundingClientRect().top;
|
||||
const newAnchorTop = currentAnchor && currentAnchor !== nextAnchor
|
||||
const newAnchorTop = currentAnchor && currentAnchor.offsetParent && currentAnchor !== nextAnchor
|
||||
? currentAnchor.getBoundingClientRect().top
|
||||
: nextAnchorTop;
|
||||
const isMovingUp = (
|
||||
@ -161,7 +161,7 @@ const InfiniteScroll: FC<OwnProps> = ({
|
||||
const nextAnchor = listItemElements[listLength - 1];
|
||||
if (nextAnchor) {
|
||||
const nextAnchorTop = nextAnchor.getBoundingClientRect().top;
|
||||
const newAnchorTop = currentAnchor && currentAnchor !== nextAnchor
|
||||
const newAnchorTop = currentAnchor && currentAnchor.offsetParent && currentAnchor !== nextAnchor
|
||||
? currentAnchor.getBoundingClientRect().top
|
||||
: nextAnchorTop;
|
||||
const isMovingDown = (
|
||||
@ -179,7 +179,7 @@ const InfiniteScroll: FC<OwnProps> = ({
|
||||
}
|
||||
|
||||
if (!isUpdated) {
|
||||
if (currentAnchor) {
|
||||
if (currentAnchor && currentAnchor.offsetParent) {
|
||||
stateRef.current.currentAnchorTop = currentAnchor.getBoundingClientRect().top;
|
||||
} else {
|
||||
const nextAnchor = listItemElements[0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user