Sticker Modal: Fix endless API requests (#1924)

This commit is contained in:
Alexander Zinchuk 2022-07-08 15:00:06 +02:00
parent e22ee992a1
commit b22877cbbf

View File

@ -76,7 +76,7 @@ const StickerSetModal: FC<OwnProps & StateProps> = ({
} = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE, isDisabled: !isOpen });
useEffect(() => {
if (isOpen) {
if (isOpen && !stickerSet?.stickers) {
if (fromSticker) {
const { stickerSetId, stickerSetAccessHash } = fromSticker;
loadStickers({
@ -89,7 +89,7 @@ const StickerSetModal: FC<OwnProps & StateProps> = ({
});
}
}
}, [isOpen, fromSticker, loadStickers, stickerSetShortName]);
}, [isOpen, fromSticker, loadStickers, stickerSetShortName, stickerSet]);
const handleSelect = useCallback((sticker: ApiSticker, isSilent?: boolean, isScheduleRequested?: boolean) => {
sticker = {