From 87840629dae8b9ac452682aa4d0ed58602942588 Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Fri, 6 Dec 2024 19:43:56 +0400 Subject: [PATCH] URL: Use corrent method field (#5267) --- src/util/deeplink.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/deeplink.ts b/src/util/deeplink.ts index 3554a67a1..e91f06a07 100644 --- a/src/util/deeplink.ts +++ b/src/util/deeplink.ts @@ -6,7 +6,6 @@ import type { DeepLinkMethod, PrivateMessageLink } from './deepLinkParser'; import { API_CHAT_TYPES, RE_TG_LINK } from '../config'; import { toChannelId } from '../global/helpers'; import { tryParseDeepLink } from './deepLinkParser'; -import { IS_SAFARI } from './windowEnvironment'; export const processDeepLink = (url: string): boolean => { const actions = getActions(); @@ -54,13 +53,12 @@ export const processDeepLink = (url: string): boolean => { } const { - protocol, searchParams, pathname, hostname, + protocol, searchParams, hostname, } = new URL(url); if (protocol !== 'tg:') return false; - // Safari thinks the path in tg://path links is hostname for some reason - const method = (IS_SAFARI ? hostname : pathname).replace(/^\/\//, '') as DeepLinkMethod; + const method = hostname as DeepLinkMethod; const params = Object.fromEntries(searchParams); const {