mirror of
https://github.com/cheveguerra/whatsapp-api-tutorial.git
synced 2026-04-18 03:39:27 +00:00
Fix multiple account first running ready status
This commit is contained in:
@@ -155,6 +155,17 @@ const init = function(socket) {
|
|||||||
|
|
||||||
if (savedSessions.length > 0) {
|
if (savedSessions.length > 0) {
|
||||||
if (socket) {
|
if (socket) {
|
||||||
|
/**
|
||||||
|
* At the first time of running (e.g. restarting the server), our client is not ready yet!
|
||||||
|
* It will need several time to authenticating.
|
||||||
|
*
|
||||||
|
* So to make people not confused for the 'ready' status
|
||||||
|
* We need to make it as FALSE for this condition
|
||||||
|
*/
|
||||||
|
savedSessions.forEach((e, i, arr) => {
|
||||||
|
arr[i].ready = false;
|
||||||
|
});
|
||||||
|
|
||||||
socket.emit('init', savedSessions);
|
socket.emit('init', savedSessions);
|
||||||
} else {
|
} else {
|
||||||
savedSessions.forEach(sess => {
|
savedSessions.forEach(sess => {
|
||||||
|
|||||||
Reference in New Issue
Block a user