From e19770ef3a0d089ea5a887fa17ea1be94dea0031 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 25 Jun 2020 10:29:17 +0530 Subject: [PATCH] reject () fix --- WhatsAppWeb.Session.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WhatsAppWeb.Session.js b/WhatsAppWeb.Session.js index 6347997..4615051 100644 --- a/WhatsAppWeb.Session.js +++ b/WhatsAppWeb.Session.js @@ -285,7 +285,7 @@ module.exports = { resolve () }) } else { - throw "You're not even connected, you can't log out" + reject("You're not even connected, you can't log out") } }) .then (() => this.close ()) @@ -300,7 +300,7 @@ module.exports = { const keys = Object.keys (this.callbacks) keys.forEach (key => { if (!key.includes ("function:")) { - this.callbacks[key].reject ("connection closed") + this.callbacks[key].errCallback ("connection closed") delete this.callbacks[key] } } )