Custom Emoji Modal: Fix icons playback on second opening (#2822)
This commit is contained in:
parent
e3269baf14
commit
033422581b
@ -10,6 +10,7 @@ import buildClassName from '../../util/buildClassName';
|
|||||||
|
|
||||||
import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
|
import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
|
||||||
import usePrevious from '../../hooks/usePrevious';
|
import usePrevious from '../../hooks/usePrevious';
|
||||||
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
import Modal from '../ui/Modal';
|
import Modal from '../ui/Modal';
|
||||||
import StickerSetCard from './StickerSetCard';
|
import StickerSetCard from './StickerSetCard';
|
||||||
@ -30,10 +31,13 @@ const CustomEmojiSetsModal: FC<OwnProps & StateProps> = ({
|
|||||||
onClose,
|
onClose,
|
||||||
}) => {
|
}) => {
|
||||||
const { openStickerSet } = getActions();
|
const { openStickerSet } = getActions();
|
||||||
|
const lang = useLang();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const customEmojiModalRef = useRef<HTMLDivElement>(null);
|
const customEmojiModalRef = useRef<HTMLDivElement>(null);
|
||||||
const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: customEmojiModalRef });
|
const { observe: observeIntersectionForCovers } = useIntersectionObserver({
|
||||||
|
rootRef: customEmojiModalRef, isDisabled: !customEmojiSets,
|
||||||
|
});
|
||||||
|
|
||||||
const prevCustomEmojiSets = usePrevious(customEmojiSets);
|
const prevCustomEmojiSets = usePrevious(customEmojiSets);
|
||||||
const renderingCustomEmojiSets = customEmojiSets || prevCustomEmojiSets;
|
const renderingCustomEmojiSets = customEmojiSets || prevCustomEmojiSets;
|
||||||
@ -50,9 +54,9 @@ const CustomEmojiSetsModal: FC<OwnProps & StateProps> = ({
|
|||||||
className={styles.root}
|
className={styles.root}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
hasCloseButton
|
hasCloseButton
|
||||||
title="Sets of used emoji"
|
title={lang('lng_custom_emoji_used_sets')}
|
||||||
>
|
>
|
||||||
<div className={buildClassName(styles.sets, 'custom-scroll')} ref={customEmojiModalRef}>
|
<div className={buildClassName(styles.sets, 'custom-scroll')} ref={customEmojiModalRef} teactFastList>
|
||||||
{renderingCustomEmojiSets?.map((customEmojiSet) => (
|
{renderingCustomEmojiSets?.map((customEmojiSet) => (
|
||||||
<StickerSetCard
|
<StickerSetCard
|
||||||
key={customEmojiSet.id}
|
key={customEmojiSet.id}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user