Update Support.tsx

This commit is contained in:
Egor
2026-01-16 02:31:08 +03:00
committed by GitHub
parent f051828aa7
commit 362fa5d0bc

View File

@@ -271,14 +271,20 @@ export default function Support() {
if (supportConfig && !supportConfig.tickets_enabled) { if (supportConfig && !supportConfig.tickets_enabled) {
const getSupportMessage = () => { const getSupportMessage = () => {
if (supportConfig.support_type === 'profile') { if (supportConfig.support_type === 'profile') {
const supportUsername = supportConfig.support_username || '@support'
return { return {
title: t('support.ticketsDisabled'), title: t('support.ticketsDisabled'),
message: t('support.useProfile'), message: t('support.contactSupport', { username: supportUsername }),
buttonText: t('support.goToProfile'), buttonText: t('support.contactUs'),
buttonAction: () => { buttonAction: () => {
const webApp = window.Telegram?.WebApp const webApp = window.Telegram?.WebApp
if (webApp?.close) { const url = supportUsername.startsWith('@')
webApp.close() ? `https://t.me/${supportUsername.slice(1)}`
: `https://t.me/${supportUsername}`
if (webApp?.openTelegramLink) {
webApp.openTelegramLink(url)
} else {
window.open(url, '_blank')
} }
}, },
} }