Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
MobCode100 committed Dec 12, 2024
1 parent 7bde5dd commit 485fb80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ class Client extends EventEmitter {
this.pupPage.on('response', async (res) => {
const textContent = await res.text();
// Get pairing code expiration time in seconds
if(this.PairingCodeTTL == null && this.options.pairWithPhoneNumber.phoneNumber){
if(this.pairingCodeTTL == null && this.options.pairWithPhoneNumber.phoneNumber){
const index = textContent.indexOf('("WAWebAltDeviceLinkingApi",[');
if(index > -1){
const execRegex = (reg) => {
Expand All @@ -811,7 +811,7 @@ class Client extends EventEmitter {
const captureVarName = execRegex(/.codeGenerationTs>(.+?)\)/g);
// Find last occurrence of the variable definition
const captureValue = execRegex(new RegExp(`${captureVarName[1]}=(\\d+)(?!.*${captureVarName[1]}=.+?codeGenerationTs>)`,"g"));
this.PairingCodeTTL = Number(captureValue[1]);
this.pairingCodeTTL = Number(captureValue[1]);
}
}
if(res.ok() && res.url() === WhatsWebURL) {
Expand Down

0 comments on commit 485fb80

Please sign in to comment.