fix: Fixed reconnect with pairing code or qrcode

This commit is contained in:
Davidson Gomes 2023-07-24 18:21:11 -03:00
parent 7d6a130cf9
commit f7293255cf
3 changed files with 11 additions and 9 deletions

View File

@ -1,3 +1,9 @@
# 1.4.1 (homolog)
### Fixed
* Fixed reconnect with pairing code or qrcode
# 1.4.0 (2023-07-24 17:03)
### Features

View File

@ -107,7 +107,7 @@ export class InstanceController {
if (qrcode) {
this.logger.verbose('creating qrcode');
await instance.connectToWhatsapp(number);
await delay(3000);
await delay(5000);
getQrcode = instance.qrCode;
}
@ -214,7 +214,7 @@ export class InstanceController {
this.logger.verbose('connecting');
await instance.connectToWhatsapp(number);
await delay(2000);
await delay(5000);
return instance.qrCode;
}

View File

@ -606,11 +606,14 @@ export class WAStartupService {
color: { light: '#ffffff', dark: '#198754' },
};
console.log(this.phoneNumber);
if (this.phoneNumber) {
await delay(2000);
this.instance.qrcode.pairingCode = await this.client.requestPairingCode(
this.phoneNumber,
);
} else {
this.instance.qrcode.pairingCode = null;
}
this.logger.verbose('Generating QR code');
@ -894,13 +897,6 @@ export class WAStartupService {
this.phoneNumber = number;
// if (number) {
// this.logger.verbose('creating pairing code');
// await delay(5000);
// this.phoneNumber = number;
// this.instance.qrcode.pairingCode = await this.client.requestPairingCode(number);
// }
return this.client;
} catch (error) {
this.logger.error(error);