fix: kill participation is 0% if ally team didn't make any

This commit is contained in:
Valentin Kaelin 2019-10-21 18:24:28 +02:00
parent d2bfb487ba
commit 668930d7ca
2 changed files with 12 additions and 11 deletions

View file

@ -53,7 +53,8 @@ class MatchTransformer extends BumblebeeTransformer {
}
return prev + current.stats.kills
}, 0)
const kp = +((kills + assists) * 100 / totalKills).toFixed(1) + '%'
const kp = totalKills === 0 ? '0%' : +((kills + assists) * 100 / totalKills).toFixed(1) + '%'
let primaryRune = null
let secondaryRune = null