diff --git a/src/components/sidebarLeft/index.ts b/src/components/sidebarLeft/index.ts index e01cfe36..c0f2e1f0 100644 --- a/src/components/sidebarLeft/index.ts +++ b/src/components/sidebarLeft/index.ts @@ -24,7 +24,7 @@ import AppNewChannelTab from "./tabs/newChannel"; import AppContactsTab from "./tabs/contacts"; import AppArchivedTab from "./tabs/archivedTab"; import AppAddMembersTab from "./tabs/addMembers"; -import { FormatterArguments, i18n, i18n_, LangPackKey } from "../../lib/langPack"; +import I18n, { FormatterArguments, i18n, i18n_, LangPackKey } from "../../lib/langPack"; import AppPeopleNearbyTab from "./tabs/peopleNearby"; import { ButtonMenuItemOptions } from "../buttonMenu"; import CheckboxField from "../checkboxField"; @@ -175,9 +175,8 @@ export class AppSidebarLeft extends SidebarSlider { icon: 'help', text: 'TelegramFeatures', onClick: () => { - appImManager.openUsername({ - userName: 'TelegramTips' - }); + const url = I18n.format('TelegramFeaturesUrl', true); + appImManager.openUrl(url); } }, { icon: 'bug', diff --git a/src/lang.ts b/src/lang.ts index 5dcfc9c1..1dd49228 100644 --- a/src/lang.ts +++ b/src/lang.ts @@ -689,6 +689,7 @@ const lang = { "ReportChatIllegalDrugs": "Illegal Drugs", "ReportChatPersonalDetails": "Personal Details", "VoipPeerIncompatible": "**%1$s**'s app is using an incompatible protocol. They need to update their app before you can call them.", + "TelegramFeaturesUrl": "https://t.me/TelegramTips", // * macos "AccountSettings.Filters": "Chat Folders", diff --git a/src/lib/appManagers/appImManager.ts b/src/lib/appManagers/appImManager.ts index 90188cea..e1d3e452 100644 --- a/src/lib/appManagers/appImManager.ts +++ b/src/lib/appManagers/appImManager.ts @@ -828,6 +828,14 @@ export class AppImManager { } } + public openUrl(url: string) { + const {url: wrappedUrl, onclick} = RichTextProcessor.wrapUrl(url); + const a = document.createElement('a'); + a.href = wrappedUrl; + + (window as any)[onclick](a); + } + private addAnchorListener(options: { name: 'showMaskedAlert' | 'execBotCommand' | 'searchByHashtag' | 'addstickers' | 'im' | 'resolve' | 'privatepost' | 'addstickers' | 'voicechat' | 'joinchat' | 'join',