mirror of
https://github.com/cheveguerra/whatsapp-api-tutorial.git
synced 2026-04-17 11:26:13 +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 (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);
|
||||
} else {
|
||||
savedSessions.forEach(sess => {
|
||||
|
||||
Reference in New Issue
Block a user