Skip to content

Commit

Permalink
fix: Fixed login by qr code
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Mar 11, 2024
1 parent 061117f commit 5ebd5f5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/api/layers/host.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ export class HostLayer {
);

await this.page.exposeFunction('checkQrCode', () => this.checkQrCode());
await this.page.exposeFunction('loginByCode', (phone: string) =>
/*await this.page.exposeFunction('loginByCode', (phone: string) =>
this.loginByCode(phone)
);
);*/
await this.page.exposeFunction('checkInChat', () => this.checkInChat());

this.checkStartInterval = setInterval(() => this.checkStart(), 5000);
Expand Down Expand Up @@ -197,7 +197,7 @@ export class HostLayer {
if (!result?.urlCode || this.urlCode === result.urlCode) {
return;
}
if (typeof this.options.phoneNumber !== undefined) {
if (typeof this.options.phoneNumber === 'string') {
return this.loginByCode(this.options.phoneNumber);
}
this.urlCode = result.urlCode;
Expand Down Expand Up @@ -368,7 +368,7 @@ export class HostLayer {
if (authenticated === false) {
this.log(
'http',
typeof this.options.phoneNumber !== undefined
typeof this.options.phoneNumber === 'string'
? 'Waiting for Login by Code...'
: 'Waiting for QRCode Scan...'
);
Expand All @@ -377,7 +377,7 @@ export class HostLayer {

this.log(
'http',
typeof this.options.phoneNumber !== undefined
typeof this.options.phoneNumber === 'string'
? 'Checking Login by Code status...'
: 'Checking QRCode status...'
);
Expand Down

0 comments on commit 5ebd5f5

Please sign in to comment.