forked from AkkomaGang/admin-fe
Fix sorting users when there is a user without a nickname of ID
This commit is contained in:
parent
f22485cc21
commit
0a92e71c44
1 changed files with 5 additions and 3 deletions
|
@ -52,9 +52,11 @@ const users = {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
state.fetchedUsers = [...usersWithoutSwapped, ...users].sort((a, b) =>
|
const updatedUsers = [...usersWithoutSwapped, ...users]
|
||||||
a.nickname.localeCompare(b.nickname)
|
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) => {
|
SET_COUNT: (state, count) => {
|
||||||
state.totalUsersCount = count
|
state.totalUsersCount = count
|
||||||
|
|
Loading…
Reference in a new issue