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", "JoinByPeekGroupTitle": "Join Group",
"YouWereKicked": "you were removed", "YouWereKicked": "you were removed",
"ViaBot": "via", "ViaBot": "via",
"InviteExpired": "This invite link has expired.",
"NoUsernameFound": "There is no Telegram account with this username.",
// * macos // * macos
"AccountSettings.Filters": "Chat Folders", "AccountSettings.Filters": "Chat Folders",

View File

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