mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-13 21:44:40 -04:00
Fixed NaN in ladder in case a player has never played before
This commit is contained in:
parent
424390ae84
commit
3f3eeab02a
2 changed files with 5 additions and 2 deletions
app
|
@ -27,7 +27,7 @@ div#columns.row
|
|||
a(href="/play/level/#{level.get('slug') || level.id}/?team=#{team.otherTeam}&opponent=#{session.id}")
|
||||
span(data-i18n="ladder.fight") Fight!
|
||||
|
||||
if !inTheTop && ! me.get('anonymous')
|
||||
if !inTheTop && ! me.get('anonymous') && team.leaderboard.hasSubmitted()
|
||||
tr(class="active")
|
||||
td(colspan=4).ellipsis-row ...
|
||||
for session in team.leaderboard.nearbySessions()
|
||||
|
|
|
@ -80,7 +80,10 @@ class LeaderboardData
|
|||
|
||||
inTopSessions: ->
|
||||
return me.id in (session.attributes.creator for session in @topPlayers.models)
|
||||
|
||||
|
||||
hasSubmitted: =>
|
||||
return 'totalScore' in @session
|
||||
|
||||
nearbySessions: ->
|
||||
return unless @session
|
||||
l = []
|
||||
|
|
Loading…
Add table
Reference in a new issue