From 033422581b6900938628de2482936de81aaae936 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sun, 19 Mar 2023 22:31:35 -0500 Subject: [PATCH] Custom Emoji Modal: Fix icons playback on second opening (#2822) --- src/components/common/CustomEmojiSetsModal.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/common/CustomEmojiSetsModal.tsx b/src/components/common/CustomEmojiSetsModal.tsx index 91b83d524..8cc4295db 100644 --- a/src/components/common/CustomEmojiSetsModal.tsx +++ b/src/components/common/CustomEmojiSetsModal.tsx @@ -10,6 +10,7 @@ import buildClassName from '../../util/buildClassName'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; import usePrevious from '../../hooks/usePrevious'; +import useLang from '../../hooks/useLang'; import Modal from '../ui/Modal'; import StickerSetCard from './StickerSetCard'; @@ -30,10 +31,13 @@ const CustomEmojiSetsModal: FC = ({ onClose, }) => { const { openStickerSet } = getActions(); + const lang = useLang(); // eslint-disable-next-line no-null/no-null const customEmojiModalRef = useRef(null); - const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: customEmojiModalRef }); + const { observe: observeIntersectionForCovers } = useIntersectionObserver({ + rootRef: customEmojiModalRef, isDisabled: !customEmojiSets, + }); const prevCustomEmojiSets = usePrevious(customEmojiSets); const renderingCustomEmojiSets = customEmojiSets || prevCustomEmojiSets; @@ -50,9 +54,9 @@ const CustomEmojiSetsModal: FC = ({ className={styles.root} onClose={onClose} hasCloseButton - title="Sets of used emoji" + title={lang('lng_custom_emoji_used_sets')} > -
+
{renderingCustomEmojiSets?.map((customEmojiSet) => (