From 5ebd5f5f140909d0e05984173190dc375a79ed2b Mon Sep 17 00:00:00 2001 From: icleitoncosta Date: Mon, 11 Mar 2024 14:38:14 -0300 Subject: [PATCH] fix: Fixed login by qr code --- src/api/layers/host.layer.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/layers/host.layer.ts b/src/api/layers/host.layer.ts index 6894ce0ca..01c048f0d 100644 --- a/src/api/layers/host.layer.ts +++ b/src/api/layers/host.layer.ts @@ -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); @@ -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; @@ -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...' ); @@ -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...' );