Fixed NaN in ladder in case a player has never played before

This commit is contained in:
Ruben Vereecken 2014-03-24 19:46:50 +01:00
parent 424390ae84
commit 3f3eeab02a
2 changed files with 5 additions and 2 deletions
app
templates/play/ladder
views/play/ladder

View file

@ -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()

View file

@ -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 = []