Fix sort matches by position

only working in fx by luck
This commit is contained in:
Thor77 2022-07-02 18:05:06 +02:00
parent a247a025ed
commit 261261ebea
1 changed files with 9 additions and 1 deletions

View File

@ -72,7 +72,15 @@ function convertTournament(apiTournament) {
function convertPlayoffStage(apiStage) {
return {
id: apiStage.id, level: apiStage.level, matches: apiStage.matches.sort((a, b) => a.position > b.position).map(match => convertMatch(match, false))
id: apiStage.id, level: apiStage.level, matches: apiStage.matches.sort((a, b) => {
if (a.position < b.position) {
return -1
} else if (a.position > b.position) {
return 1
} else {
return 0
}
}).map(match => convertMatch(match, false))
};
}