fix: ally/enemy teams position in match details

This commit is contained in:
Valentin Kaelin 2019-11-26 18:39:22 +01:00
parent 7a199d3194
commit ec47fe2372

View file

@ -47,10 +47,16 @@ export default {
computed: { computed: {
allyTeam() { allyTeam() {
return this.data.blueTeam.players.some(p => p.name.toLowerCase() === this.$route.params.name.toLowerCase()) ? this.data.blueTeam : this.data.redTeam return this.data.blueTeam.players.some(p => this.compareSummonernames(p.name, this.$route.params.name)) ? this.data.blueTeam : this.data.redTeam
}, },
enemyTeam() { enemyTeam() {
return this.data.blueTeam.players.some(p => p.name.toLowerCase() === this.$route.params.name.toLowerCase()) ? this.data.redTeam : this.data.blueTeam return this.data.blueTeam.players.some(p => this.compareSummonernames(p.name, this.$route.params.name)) ? this.data.redTeam : this.data.blueTeam
}
},
methods: {
compareSummonernames(a, b) {
return a.toLowerCase().replace(/ /g, '') === b.toLowerCase().replace(/ /g, '')
} }
} }
} }