diff --git a/src/util/deepLinkParser.ts b/src/util/deepLinkParser.ts index d4e787412..0948056b9 100644 --- a/src/util/deepLinkParser.ts +++ b/src/util/deepLinkParser.ts @@ -10,7 +10,7 @@ import { isUsernameValid } from './entities/username'; export type DeepLinkMethod = 'resolve' | 'login' | 'passport' | 'settings' | 'join' | 'addstickers' | 'addemoji' | 'setlanguage' | 'addtheme' | 'confirmphone' | 'socks' | 'proxy' | 'privatepost' | 'bg' | 'share' | 'msg' | 'msg_url' | 'invoice' | 'addlist' | 'boost' | 'giftcode' | 'message' | 'premium_offer' | 'premium_multigift' | 'stars_topup' - | 'nft' | 'stars'; + | 'nft' | 'stars' | 'ton'; interface PublicMessageLink { type: 'publicMessageLink'; @@ -107,6 +107,10 @@ interface StarsModalLink { type: 'stars'; } +interface TonModalLink { + type: 'ton'; +} + interface SettingsScreenLink { type: 'settings'; screen?: 'devices' | 'folders' | 'language' | 'privacy' | 'editProfile' | 'theme'; @@ -127,6 +131,7 @@ type DeepLink = ChatBoostLink | GiftUniqueLink | StarsModalLink | + TonModalLink | SettingsScreenLink; type BuilderParams = Record, string | undefined>; @@ -260,6 +265,8 @@ function parseTgLink(url: URL) { return buildGiftUniqueLink({ slug: queryParams.slug }); case 'stars': return { type: 'stars' } satisfies StarsModalLink; + case 'ton': + return { type: 'ton' } satisfies TonModalLink; case 'settings': return buildSettingsScreenLink({ screen: pathParams.length === 1 ? pathParams[0] : undefined }); default: @@ -469,6 +476,8 @@ function getTgDeepLinkType( return 'giftUniqueLink'; case 'stars': return 'stars'; + case 'ton': + return 'ton'; case 'settings': { return 'settings'; } diff --git a/src/util/deeplink.ts b/src/util/deeplink.ts index 5d102a224..791b4e89e 100644 --- a/src/util/deeplink.ts +++ b/src/util/deeplink.ts @@ -4,7 +4,7 @@ import type { ApiChatType, ApiFormattedText } from '../api/types'; import type { DeepLinkMethod } from './deepLinkParser'; import { LeftColumnContent, SettingsScreens } from '../types'; -import { API_CHAT_TYPES, RE_TG_LINK } from '../config'; +import { API_CHAT_TYPES, RE_TG_LINK, TON_CURRENCY_CODE } from '../config'; import { IS_BAD_URL_PARSER } from './browser/globalEnvironment'; import { tryParseDeepLink } from './deepLinkParser'; @@ -105,6 +105,9 @@ export const processDeepLink = (url: string): boolean => { case 'stars': actions.openStarsBalanceModal({}); break; + case 'ton': + actions.openStarsBalanceModal({ currency: TON_CURRENCY_CODE }); + break; default: break; }