Skip to content

Commit

Permalink
fix: Fixed compatibility with WhatsApp 2.2208.11
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Mar 16, 2022
1 parent 1fec78c commit 8894d1a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/whatsapp/functions/isAuthenticated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ import { exportModule } from '../exportModule';
/** @whatsapp 13194 */
export declare function isAuthenticated(): boolean;

/**
* @whatsapp 13194
* whatsapp >= 2.2208.11
*/
export declare function isLoggedIn(): boolean;

exportModule(
exports,
{
isAuthenticated: 'Z',
isAuthenticated: (m) => m.isLoggedIn || m.Z,
isLoggedIn: (m) => m.isLoggedIn || m.Z,
},
(m) =>
m.Z.toString().includes('isRegistered') &&
m.Z.toString().includes('getLoginTokens')
(m.Z?.toString().includes('isRegistered') &&
m.Z?.toString().includes('getLoginTokens')) ||
m.isLoggedIn // whatsapp >= 2.2208.11
);

0 comments on commit 8894d1a

Please sign in to comment.