use correct code

This commit is contained in:
Adrian Thompson
2020-10-30 13:52:48 +01:00
parent 0d0022f420
commit 8758752b26

View File

@@ -29,15 +29,8 @@ export default {
},
async mounted() {
let response = await highscoreStatistics();
response.sort((a, b) => {
return a.wins.length > b.wins.length ? -1 : 1;
});
response = response.filter(
person => person.name != null && person.name != ""
);
this.highscore = response.slice(0, 5);
// response.sort((a, b) => a.wins.length < b.wins.length ? 1 : -1)
// this.highscore = this.generateScoreBoard(response.slice(0, 10));
response.sort((a, b) => a.wins.length < b.wins.length ? 1 : -1)
this.highscore = this.generateScoreBoard(response.slice(0, 5));
},
methods: {
generateScoreBoard(highscore=this.highscore) {