Skip to content

Commit

Permalink
fix hero_id 0 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Jun 16, 2016
1 parent 5eac1fe commit cf5b9fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
14 changes: 9 additions & 5 deletions store/buildPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,16 @@ function buildPlayer(options, cb)
{
for (var id in aggData.hero_id.counts)
{
heroes_list.push(
//exclude invalid hero_ids
if (Number(id))
{
hero_id: id,
games: aggData.hero_id.counts[id],
win: aggData.hero_id.win_counts[id]
});
heroes_list.push(
{
hero_id: id,
games: aggData.hero_id.counts[id],
win: aggData.hero_id.win_counts[id]
});
}
}
}
else if (aggData.heroes)
Expand Down
5 changes: 3 additions & 2 deletions views/mixins/hero_table.jade
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ mixin hero_table(rows, short)
- var hero = constants.heroes[h.hero_id]
tr
td.text-left.small
img.img-sm(src=hero.img, title=hero.localized_name)
=hero.localized_name
if hero
img.img-sm(src=hero.img, title=hero.localized_name)
=hero.localized_name
td.rankable=h.games
td.rankable
+progress_bar(h.win, h.games)
Expand Down

0 comments on commit cf5b9fc

Please sign in to comment.