From b35090a0c7674feace4208a1719244dd5e67c7c4 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 31 Aug 2022 15:00:39 +0200 Subject: [PATCH] Web App Modal: Do not close along with Payment Modal (#2008) --- src/components/main/WebAppModal.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/main/WebAppModal.tsx b/src/components/main/WebAppModal.tsx index 9874cb76d..fefb512fd 100644 --- a/src/components/main/WebAppModal.tsx +++ b/src/components/main/WebAppModal.tsx @@ -125,7 +125,7 @@ const WebAppModal: FC = ({ }); } - if (eventType === 'web_app_open_tg_link') { + if (eventType === 'web_app_open_tg_link' && !isPaymentModalOpen) { const linkUrl = TME_LINK_PREFIX + eventData.path_full; openTelegramLink({ url: linkUrl }); closeWebApp(); @@ -185,7 +185,10 @@ const WebAppModal: FC = ({ if (!eventData.message.trim().length || !eventData.buttons?.length || eventData.buttons.length > 3) return; setPopupParams(eventData); } - }, [bot, buttonText, closeWebApp, openInvoice, openTelegramLink, sendWebViewData, setWebAppPaymentSlug]); + }, [ + bot, buttonText, closeWebApp, openInvoice, openTelegramLink, sendWebViewData, setWebAppPaymentSlug, + isPaymentModalOpen, + ]); const { ref, reloadFrame, sendEvent, sendViewport, sendTheme,