From b9e5d2100b2f26ae8fa1f8faa7c22bb9163c5d3b Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Fri, 29 Aug 2025 08:58:01 +0200 Subject: [PATCH] Mini Apps: Prevent TG link opening from closing app (#6174) --- src/components/common/Composer.scss | 12 +----------- .../modals/webApp/WebAppModalTabContent.module.scss | 10 +--------- .../modals/webApp/WebAppModalTabContent.tsx | 7 ++----- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/components/common/Composer.scss b/src/components/common/Composer.scss index d0b529011..e76cff180 100644 --- a/src/components/common/Composer.scss +++ b/src/components/common/Composer.scss @@ -508,7 +508,7 @@ width: 2rem; max-width: clamp(0px, 12rem, 25vw); height: 2rem; - margin: 0 0.5rem 0.75rem; + margin: 0 0.5rem 0.5rem; padding: 0 var(--padding-sides); border-radius: 0.5rem; @@ -523,10 +523,6 @@ width: calc(var(--bot-menu-text-width) + var(--padding-sides) * 2 + var(--icon-gap) + var(--icon-width)); border-radius: 1rem; } - - @media (max-width: 600px) { - margin-bottom: 0.4375rem; - } } .bot-menu-icon { @@ -616,15 +612,9 @@ animation: recording-blink-like-macos 1.5s infinite; } - - @media (max-width: 600px) { - height: 2.875rem; - line-height: 2.875rem; - } } @media (max-width: 600px) { - --action-button-size: 2.875rem; --action-button-compact-fix: -0.6875rem; } } diff --git a/src/components/modals/webApp/WebAppModalTabContent.module.scss b/src/components/modals/webApp/WebAppModalTabContent.module.scss index 02ff5147e..93a7b5fd0 100644 --- a/src/components/modals/webApp/WebAppModalTabContent.module.scss +++ b/src/components/modals/webApp/WebAppModalTabContent.module.scss @@ -156,18 +156,10 @@ &.one-row { align-items: center; height: 4rem; - - @media (max-width: 600px) { - height: 3.5rem; - } } &.two-rows { - height: 7.75rem; - - @media (max-width: 600px) { - height: 6.9375rem; - } + height: 8rem; } &.left-to-right { diff --git a/src/components/modals/webApp/WebAppModalTabContent.tsx b/src/components/modals/webApp/WebAppModalTabContent.tsx index b58df8bb6..79bcb5472 100644 --- a/src/components/modals/webApp/WebAppModalTabContent.tsx +++ b/src/components/modals/webApp/WebAppModalTabContent.tsx @@ -568,9 +568,10 @@ const WebAppModalTabContent: FC = ({ } if (eventType === 'web_app_open_tg_link') { + changeWebAppModalState({ state: 'minimized' }); + const linkUrl = TME_LINK_PREFIX + eventData.path_full; openTelegramLink({ url: linkUrl, shouldIgnoreCache: eventData.force_request }); - closeActiveWebApp(); } if (eventType === 'web_app_setup_back_button') { @@ -1086,7 +1087,6 @@ const WebAppModalTabContent: FC = ({ disabled={!secondaryButtonCurrentIsActive && !secondaryButton?.isProgressVisible} nonInteractive={secondaryButton?.isProgressVisible} onClick={handleSecondaryButtonClick} - size="smaller" > {!secondaryButton?.isProgressVisible && secondaryButtonCurrentText} {secondaryButton?.isProgressVisible @@ -1103,7 +1103,6 @@ const WebAppModalTabContent: FC = ({ disabled={!mainButtonCurrentIsActive && !mainButton?.isProgressVisible} nonInteractive={mainButton?.isProgressVisible} onClick={handleMainButtonClick} - size="smaller" > {!mainButton?.isProgressVisible && mainButtonCurrentText} {mainButton?.isProgressVisible && } @@ -1128,8 +1127,6 @@ const WebAppModalTabContent: FC = ({ className="confirm-dialog-button" color={button.type === 'destructive' ? 'danger' : 'primary'} isText - size="smaller" - onClick={() => handleAppPopupClose(button.id)} > {button.text || oldLang(DEFAULT_BUTTON_TEXT[button.type])}