mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-18 19:32:21 -06:00
fix: Fixed reconnect with pairing code or qrcode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user