mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
🐛Sort course details nameless members
This commit is contained in:
parent
a74a09a532
commit
1bd5078ecf
1 changed files with 8 additions and 2 deletions
|
@ -281,7 +281,10 @@ module.exports = class CourseDetailsView extends RootView
|
|||
@sortedMembers = @courseInstance.get('members')
|
||||
switch @memberSort
|
||||
when "nameDesc"
|
||||
@sortedMembers.sort (a, b) => @memberUserMap[b]?.get('name').localeCompare(@memberUserMap[a]?.get('name'))
|
||||
@sortedMembers.sort (a, b) =>
|
||||
aName = @memberUserMap[a]?.get('name') ? 'Anoner'
|
||||
bName = @memberUserMap[b]?.get('name') ? 'Anoner'
|
||||
bName.localeCompare(aName)
|
||||
when "progressAsc"
|
||||
@sortedMembers.sort (a, b) =>
|
||||
for levelID, level of @campaign.get('levels')
|
||||
|
@ -299,4 +302,7 @@ module.exports = class CourseDetailsView extends RootView
|
|||
return -1
|
||||
0
|
||||
else
|
||||
@sortedMembers.sort (a, b) => @memberUserMap[a]?.get('name').localeCompare(@memberUserMap[b]?.get('name'))
|
||||
@sortedMembers.sort (a, b) =>
|
||||
aName = @memberUserMap[a]?.get('name') ? 'Anoner'
|
||||
bName = @memberUserMap[b]?.get('name') ? 'Anoner'
|
||||
aName.localeCompare(bName)
|
||||
|
|
Loading…
Reference in a new issue