From e4e5495a7326da369c98e7cb08f25e5449bf0dd1 Mon Sep 17 00:00:00 2001 From: Nur Muhammad Date: Tue, 12 Apr 2022 08:01:41 +0800 Subject: [PATCH] Fix multiple account first running ready status --- app-multiple-account.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app-multiple-account.js b/app-multiple-account.js index 53a3a7d..2bc1a16 100644 --- a/app-multiple-account.js +++ b/app-multiple-account.js @@ -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 => {