[Dev] GramJs: Properly check app credentials (#1357)
This commit is contained in:
parent
30c27182e2
commit
3b01b58b60
@ -69,7 +69,7 @@ class TelegramClient {
|
|||||||
* @param opts
|
* @param opts
|
||||||
*/
|
*/
|
||||||
constructor(session, apiId, apiHash, opts = TelegramClient.DEFAULT_OPTIONS) {
|
constructor(session, apiId, apiHash, opts = TelegramClient.DEFAULT_OPTIONS) {
|
||||||
if (apiId === undefined || apiHash === undefined) {
|
if (!apiId || !apiHash) {
|
||||||
throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');
|
throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');
|
||||||
}
|
}
|
||||||
const args = { ...TelegramClient.DEFAULT_OPTIONS, ...opts };
|
const args = { ...TelegramClient.DEFAULT_OPTIONS, ...opts };
|
||||||
|
|||||||
@ -59,7 +59,9 @@ addReducer('apiUpdate', (global, actions, update: ApiUpdate) => {
|
|||||||
actions.signOut();
|
actions.signOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
actions.showDialog({ data: { ...update.error, hasErrorKey: true } });
|
if (actions.showDialog) {
|
||||||
|
actions.showDialog({ data: { ...update.error, hasErrorKey: true } });
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user