mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
Message List: Fix for flickering FAB in Safari
This commit is contained in:
parent
bc8f1b8ffe
commit
438c72588b
@ -4,6 +4,7 @@ import React, {
|
||||
} from '../../lib/teact/teact';
|
||||
|
||||
import { MESSAGE_LIST_SENSITIVE_AREA } from '../../config';
|
||||
import { IS_SAFARI } from '../../util/environment';
|
||||
import resetScroll from '../../util/resetScroll';
|
||||
import { useIntersectionObserver, useOnIntersect } from '../../hooks/useIntersectionObserver';
|
||||
import useOnChange from '../../hooks/useOnChange';
|
||||
@ -72,7 +73,7 @@ const MessageScroll: FC<OwnProps> = ({
|
||||
const { offsetHeight, scrollHeight, scrollTop } = containerRef.current!;
|
||||
const scrollBottom = scrollHeight - scrollTop - offsetHeight;
|
||||
const isNearBottom = scrollBottom <= FAB_THRESHOLD;
|
||||
const isAtBottom = scrollBottom === 0;
|
||||
const isAtBottom = scrollBottom === 0 || (IS_SAFARI && scrollBottom === 1);
|
||||
|
||||
onFabToggle(firstUnreadId ? !isAtBottom : !isNearBottom);
|
||||
}, [messageIds, isViewportNewest, containerRef, onFabToggle, firstUnreadId]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user