From b22877cbbfebaa1cb8b6782ed2b9f1dd5a1d0034 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 8 Jul 2022 15:00:06 +0200 Subject: [PATCH] Sticker Modal: Fix endless API requests (#1924) --- src/components/common/StickerSetModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/StickerSetModal.tsx b/src/components/common/StickerSetModal.tsx index da6c2ab0f..b8a061355 100644 --- a/src/components/common/StickerSetModal.tsx +++ b/src/components/common/StickerSetModal.tsx @@ -76,7 +76,7 @@ const StickerSetModal: FC = ({ } = 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 = ({ }); } } - }, [isOpen, fromSticker, loadStickers, stickerSetShortName]); + }, [isOpen, fromSticker, loadStickers, stickerSetShortName, stickerSet]); const handleSelect = useCallback((sticker: ApiSticker, isSilent?: boolean, isScheduleRequested?: boolean) => { sticker = {