diff --git a/src/lib/gramjs/client/TelegramClient.js b/src/lib/gramjs/client/TelegramClient.js index d5290b52..3d5643b7 100644 --- a/src/lib/gramjs/client/TelegramClient.js +++ b/src/lib/gramjs/client/TelegramClient.js @@ -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 }; diff --git a/src/modules/actions/apiUpdaters/initial.ts b/src/modules/actions/apiUpdaters/initial.ts index 6ab7baea..6c38a826 100644 --- a/src/modules/actions/apiUpdaters/initial.ts +++ b/src/modules/actions/apiUpdaters/initial.ts @@ -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; }