[Dev] GramJs: Properly check app credentials (#1357)

This commit is contained in:
Alexander Zinchuk 2021-08-04 23:34:16 +03:00
parent 30c27182e2
commit 3b01b58b60
2 changed files with 4 additions and 2 deletions

View File

@ -69,7 +69,7 @@ class TelegramClient {
* @param opts
*/
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');
}
const args = { ...TelegramClient.DEFAULT_OPTIONS, ...opts };

View File

@ -59,7 +59,9 @@ addReducer('apiUpdate', (global, actions, update: ApiUpdate) => {
actions.signOut();
}
actions.showDialog({ data: { ...update.error, hasErrorKey: true } });
if (actions.showDialog) {
actions.showDialog({ data: { ...update.error, hasErrorKey: true } });
}
break;
}