diff --git a/src/components/right/ChatExtra.tsx b/src/components/right/ChatExtra.tsx index 4101bd5d..5e0dfc52 100644 --- a/src/components/right/ChatExtra.tsx +++ b/src/components/right/ChatExtra.tsx @@ -112,7 +112,7 @@ const ChatExtra: FC = ({ {lang(userId ? 'UserBio' : 'Info')} )} - {(canInviteUsers || !username) && !!link.length && ( + {(canInviteUsers || !username) && link && ( copy(link, lang('SetUrlPlaceholder'))}>
{link}
{lang('SetUrlPlaceholder')} diff --git a/src/modules/helpers/chats.ts b/src/modules/helpers/chats.ts index ac098334..365a9b92 100644 --- a/src/modules/helpers/chats.ts +++ b/src/modules/helpers/chats.ts @@ -82,13 +82,13 @@ export function getChatDescription(chat: ApiChat) { export function getChatLink(chat: ApiChat) { const { username } = chat; - const { inviteLink } = chat.fullInfo || {}; - - if (inviteLink && inviteLink.length) { - return inviteLink; + if (username) { + return `https://t.me/${username}`; } - return username ? `https://t.me/${username}` : ''; + const { inviteLink } = chat.fullInfo || {}; + + return inviteLink; } export function getChatAvatarHash(