Added some toasts for t.me links

This commit is contained in:
Eduard Kuzmenko 2021-07-02 20:43:49 +03:00
parent 64fe85eb75
commit 2f8d977914
2 changed files with 11 additions and 0 deletions

View File

@ -484,6 +484,8 @@ const lang = {
"JoinByPeekGroupTitle": "Join Group",
"YouWereKicked": "you were removed",
"ViaBot": "via",
"InviteExpired": "This invite link has expired.",
"NoUsernameFound": "There is no Telegram account with this username.",
// * macos
"AccountSettings.Filters": "Chat Folders",

View File

@ -61,6 +61,7 @@ import PopupElement from '../../components/popups';
import singleInstance from '../mtproto/singleInstance';
import PopupStickers from '../../components/popups/stickers';
import PopupJoinChatInvite from '../../components/popups/joinChatInvite';
import { toast } from '../../components/toast';
//console.log('appImManager included33!');
@ -305,6 +306,10 @@ export class AppImManager {
}
new PopupJoinChatInvite(params[1], chatInvite).show();
}, (err) => {
if(err.type === 'INVITE_HASH_EXPIRED') {
toast(i18n('InviteExpired'));
}
});
},
parsePathname: true
@ -381,6 +386,10 @@ export class AppImManager {
const peerId = isUser ? peer.id : -peer.id;
return this.setInnerPeer(peerId, msgId);
}, (err) => {
if(err.type === 'USERNAME_NOT_OCCUPIED') {
toast(i18n('NoUsernameFound'));
}
});
}