Fixed a couple bugs with the matches tab.

This commit is contained in:
Nick Winter 2014-03-11 18:06:48 -07:00
parent 392534878a
commit 8c57b31c54
2 changed files with 4 additions and 3 deletions
app
templates/play/ladder
views/play/ladder

View file

@ -52,8 +52,9 @@ div#columns.row
if team.isRanking
td(colspan=4).alert.alert-info
| Your new code is being simulated by other players for ranking.
| This will refresh as new matches come in.
else
td(colspan=4).alert.alert-warning
| No ranked matches for this team!
| No ranked matches for the #{team.name} team!
| Play against some competitors and then come back here to get your game ranked.

View file

@ -71,7 +71,7 @@ module.exports = class MyMatchesTabView extends CocoView
for team in @teams
team.session = (s for s in @sessions.models when s.get('team') is team.id)[0]
team.readyToRank = @readyToRank(team.session)
team.isRanking = team.session.get('isRanking')
team.isRanking = team.session?.get('isRanking')
team.matches = (convertMatch(match, team.session.get('submitDate')) for match in team.session?.get('matches') or [])
team.matches.reverse()
team.score = (team.session?.get('totalScore') or 10).toFixed(2)