Message / Inline Buttons: Fix flickering arrow

This commit is contained in:
Alexander Zinchuk 2022-08-07 18:28:47 +02:00
parent 1aec0c51ef
commit 2295c21376
2 changed files with 7 additions and 5 deletions

View File

@ -190,9 +190,9 @@ export const CONTENT_NOT_SUPPORTED = 'The message is not supported on this versi
// eslint-disable-next-line max-len
export const RE_LINK_TEMPLATE = '((ftp|https?):\\/\\/)?((www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,63})\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';
export const RE_MENTION_TEMPLATE = '(@[\\w\\d_-]+)';
export const RE_TG_LINK = /^tg:(\/\/)?([?=&\d\w_-]+)?/gm;
export const RE_TME_LINK = /^(?:https?:\/\/)?(?:t\.me\/)/gm;
export const RE_TELEGRAM_LINK = /^(?:https?:\/\/)?(?:telegram\.org\/)/gm;
export const RE_TG_LINK = /^tg:(\/\/)?([?=&\d\w_-]+)?/;
export const RE_TME_LINK = /^(https?:\/\/)?t\.me\//;
export const RE_TELEGRAM_LINK = /^(https?:\/\/)?telegram\.org\//;
export const TME_LINK_PREFIX = 'https://t.me/';
// eslint-disable-next-line max-len

View File

@ -567,8 +567,10 @@ addActionHandler('openChatByPhoneNumber', async (global, actions, payload) => {
addActionHandler('openTelegramLink', (global, actions, payload) => {
const { url } = payload!;
if (url.match(RE_TG_LINK)) {
processDeepLink(url.match(RE_TG_LINK)[0]);
const tgLinkMatch = url.match(RE_TG_LINK);
if (tgLinkMatch) {
processDeepLink(tgLinkMatch[0]);
return;
}