Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: client.destroy() keeps trying to get QR code when client is not authorized yet. #249

Merged
merged 3 commits into from
Jun 9, 2020

Conversation

javierportillo
Copy link
Contributor

No description provided.

src/Client.js Outdated
@@ -118,11 +118,12 @@ class Client extends EventEmitter {
this.emit(Events.QR_RECEIVED, qr);
};
getQrCode();
let retryInterval = setInterval(getQrCode, this.options.qrRefreshIntervalMs);
this.retryInterval = setInterval(getQrCode, this.options.qrRefreshIntervalMs);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One small thing I would change is make this variable more descriptive since it's now available on client. Please change this throughout the code :)

Suggested change
this.retryInterval = setInterval(getQrCode, this.options.qrRefreshIntervalMs);
this._qrRefreshInterval = setInterval(getQrCode, this.options.qrRefreshIntervalMs);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@pedroslopez
Copy link
Owner

LGTM!

@pedroslopez pedroslopez merged commit 2abd372 into pedroslopez:master Jun 9, 2020
maznabili added a commit to maznabili/whatsapp-web.js that referenced this pull request Jun 10, 2020
fix: clear qr refresh interval on client.destroy() (pedroslopez#249)
Belfio pushed a commit to Belfio/whatsapp-web.js that referenced this pull request Jan 9, 2024
* fix: client.destroy() keeps trying to get QR code when client is not authorized yet

Co-authored-by: Javier Portillo <javier.marquez@dada-dada.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

client.destroy() keeps trying to get QR code when client is not authorized yet.
3 participants