diff --git a/src/components/common/AnimatedSticker.tsx b/src/components/common/AnimatedSticker.tsx index e000412ad..e7cb68181 100644 --- a/src/components/common/AnimatedSticker.tsx +++ b/src/components/common/AnimatedSticker.tsx @@ -2,7 +2,6 @@ import React, { FC, useEffect, useRef, memo, useCallback, useState, } from '../../lib/teact/teact'; -import { IS_IOS } from '../../util/environment'; import { fastRaf } from '../../util/schedulers'; import buildClassName from '../../util/buildClassName'; import useHeavyAnimationCheck from '../../hooks/useHeavyAnimationCheck'; @@ -190,12 +189,7 @@ const AnimatedSticker: FC = ({ // then we can play again. useBackgroundMode(freezeAnimation, unfreezeAnimationOnRaf); - const fullClassName = buildClassName( - 'AnimatedSticker', - className, - // Workaround for an iOS bug when animated stickers sometimes disappear - IS_IOS && play && 'is-playing', - ); + const fullClassName = buildClassName('AnimatedSticker', className); const style = size ? `width: ${size}px; height: ${size}px;` : undefined; diff --git a/src/components/middle/MessageList.tsx b/src/components/middle/MessageList.tsx index 305254ba8..b373f7d6c 100644 --- a/src/components/middle/MessageList.tsx +++ b/src/components/middle/MessageList.tsx @@ -1,5 +1,5 @@ import React, { - FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, + FC, memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../lib/teact/teact'; import { getGlobal, withGlobal } from '../../lib/teact/teactn'; @@ -8,7 +8,7 @@ import { GlobalActions, MessageListType } from '../../global/types'; import { LoadMoreDirection } from '../../types'; import { ANIMATION_END_DELAY, MESSAGE_LIST_SLICE, SCHEDULED_WHEN_ONLINE } from '../../config'; -import { IS_ANDROID, IS_IOS, IS_MOBILE_SCREEN } from '../../util/environment'; +import { IS_ANDROID, IS_MOBILE_SCREEN } from '../../util/environment'; import { selectChatMessages, selectIsViewportNewest, @@ -38,7 +38,7 @@ import { pick, } from '../../util/iteratees'; import { - fastRaf, debounce, throttleWithTickEnd, onTickEnd, + fastRaf, debounce, onTickEnd, } from '../../util/schedulers'; import { formatHumanDate } from '../../util/dateFormat'; import useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps'; @@ -107,7 +107,6 @@ const FOCUSING_FADE_ANIMATION_DURATION = 200; const UNREAD_DIVIDER_CLASS = 'unread-divider'; const runDebouncedForScroll = debounce((cb) => cb(), SCROLL_DEBOUNCE, false); -const runThrottledOnTickEnd = throttleWithTickEnd((cb) => cb()); const MessageList: FC = ({ chatId, @@ -335,22 +334,6 @@ const MessageList: FC = ({ containerRef.current!.dataset.normalHeight = String(containerRef.current!.offsetHeight); }, [windowHeight]); - // Workaround for an iOS bug when animated stickers sometimes disappear - useLayoutEffect(() => { - if (!IS_IOS) { - return; - } - - runThrottledOnTickEnd(() => { - if (!(containerRef.current as HTMLDivElement).querySelector('.AnimatedSticker.is-playing')) { - return; - } - - const style = (containerRef.current as HTMLDivElement).style as any; - style.webkitOverflowScrolling = style.webkitOverflowScrolling === 'auto' ? '' : 'auto'; - }); - }); - // Initial message loading useEffect(() => { if (!loadMoreAround || !isChatLoaded || isRestricted || focusingId) {