Skip to content

Commit

Permalink
Removing the duplicate profiles for a user - issue#2943
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinikammar committed Jun 19, 2020
1 parent fcc5be0 commit 312c0e0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/clientManager.js
Expand Up @@ -42,7 +42,22 @@ ClientManager.prototype.findClient = function (name) {
};

ClientManager.prototype.loadUsers = function () {
const users = this.getUsers();
let usersList = this.getUsers();
let updatedUsersList = [];

for (let i = 0; i < usersList.length; i++) {
let index = [];
for (let j = 0; j < usersList.length; j++) {
if (usersList[i].toLowerCase() === usersList[j].toLowerCase()) {
index.push(j);
}
}
if (!updatedUsersList.includes(usersList[index[0]])) {
updatedUsersList.push(usersList[index[0]]);
log.error(`Loading profile for ${usersList[index[0]]} and removing duplicate profiles`);
}
}
const users = updatedUsersList;

if (users.length === 0) {
log.info(
Expand Down

0 comments on commit 312c0e0

Please sign in to comment.