Mini Apps: Prevent TG link opening from closing app (#6174)

This commit is contained in:
zubiden 2025-08-29 08:58:01 +02:00 committed by Alexander Zinchuk
parent 4c950b34d8
commit b9e5d2100b
3 changed files with 4 additions and 25 deletions

View File

@ -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;
}
}

View File

@ -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 {

View File

@ -568,9 +568,10 @@ const WebAppModalTabContent: FC<OwnProps & StateProps> = ({
}
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<OwnProps & StateProps> = ({
disabled={!secondaryButtonCurrentIsActive && !secondaryButton?.isProgressVisible}
nonInteractive={secondaryButton?.isProgressVisible}
onClick={handleSecondaryButtonClick}
size="smaller"
>
{!secondaryButton?.isProgressVisible && secondaryButtonCurrentText}
{secondaryButton?.isProgressVisible
@ -1103,7 +1103,6 @@ const WebAppModalTabContent: FC<OwnProps & StateProps> = ({
disabled={!mainButtonCurrentIsActive && !mainButton?.isProgressVisible}
nonInteractive={mainButton?.isProgressVisible}
onClick={handleMainButtonClick}
size="smaller"
>
{!mainButton?.isProgressVisible && mainButtonCurrentText}
{mainButton?.isProgressVisible && <Spinner className={styles.mainButtonSpinner} color="white" />}
@ -1128,8 +1127,6 @@ const WebAppModalTabContent: FC<OwnProps & StateProps> = ({
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])}