Sticker Modal: Fix endless API requests (#1924)
This commit is contained in:
parent
e22ee992a1
commit
b22877cbbf
@ -76,7 +76,7 @@ const StickerSetModal: FC<OwnProps & StateProps> = ({
|
|||||||
} = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE, isDisabled: !isOpen });
|
} = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE, isDisabled: !isOpen });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpen) {
|
if (isOpen && !stickerSet?.stickers) {
|
||||||
if (fromSticker) {
|
if (fromSticker) {
|
||||||
const { stickerSetId, stickerSetAccessHash } = fromSticker;
|
const { stickerSetId, stickerSetAccessHash } = fromSticker;
|
||||||
loadStickers({
|
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) => {
|
const handleSelect = useCallback((sticker: ApiSticker, isSilent?: boolean, isScheduleRequested?: boolean) => {
|
||||||
sticker = {
|
sticker = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user