Skip to content
Snippets Groups Projects
Commit 1c2782a5 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Fix sorting users if there are users without nicknames or IDs

parent 7b7a0517
No related branches found
No related tags found
No related merge requests found
......@@ -51,9 +51,11 @@ const users = {
return
}
state.fetchedUsers = [...usersWithoutSwapped, ...users].sort((a, b) =>
a.nickname.localeCompare(b.nickname)
)
const updatedUsers = [...usersWithoutSwapped, ...users]
state.fetchedUsers = updatedUsers
.filter(user => user.nickname && user.id)
.sort((a, b) => a.nickname.localeCompare(b.nickname))
.concat(updatedUsers.filter(user => !user.nickname || !user.id))
},
SET_COUNT: (state, count) => {
state.totalUsersCount = count
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment