diff --git a/src/clientManager.js b/src/clientManager.js index c076494f..6211fb46 100644 --- a/src/clientManager.js +++ b/src/clientManager.js @@ -41,7 +41,7 @@ ClientManager.prototype.autoloadUsers = function() { process.exit(1); } - if (!users.length) { + if (users.length === 0) { log.info(noUsersWarning); } @@ -51,7 +51,7 @@ ClientManager.prototype.autoloadUsers = function() { const loaded = this.clients.map((c) => c.name); const updatedUsers = this.getUsers(); - if (!updatedUsers.length) { + if (updatedUsers.length === 0) { log.info(noUsersWarning); } diff --git a/src/command-line/list.js b/src/command-line/list.js index c6dc732f..d092ad8b 100644 --- a/src/command-line/list.js +++ b/src/command-line/list.js @@ -28,12 +28,12 @@ program return; } - if (!users.length) { - log.info(`There are currently no users. Create one with ${colors.bold("lounge add ")}.`); - } else { + if (users.length > 0) { log.info("Users:"); - for (var i = 0; i < users.length; i++) { - log.info(`${i + 1}. ${colors.bold(users[i])}`); - } + users.forEach((user, i) => { + log.info(`${i + 1}. ${colors.bold(user)}`); + }); + } else { + log.info(`There are currently no users. Create one with ${colors.bold("lounge add ")}.`); } });