Browse Source

Added some toasts for t.me links

master
Eduard Kuzmenko 4 years ago
parent
commit
2f8d977914
  1. 2
      src/lang.ts
  2. 9
      src/lib/appManagers/appImManager.ts

2
src/lang.ts

@ -484,6 +484,8 @@ const lang = { @@ -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",

9
src/lib/appManagers/appImManager.ts

@ -61,6 +61,7 @@ import PopupElement from '../../components/popups'; @@ -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 { @@ -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 { @@ -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'));
}
});
}

Loading…
Cancel
Save