|
|
@ -55,7 +55,7 @@ export class SeasonStandingsComponent { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.onUpdatedStandings(this.season.standings); |
|
|
this.sortStandings(this.season.standings); |
|
|
console.log("Season Standings - Begin") |
|
|
console.log("Season Standings - Begin") |
|
|
console.log(this.season); |
|
|
console.log(this.season); |
|
|
console.log(this.sortedStandings); |
|
|
console.log(this.sortedStandings); |
|
|
@ -68,6 +68,15 @@ export class SeasonStandingsComponent { |
|
|
this.sseService.unregisterEventHandler('season-standings.updated', this.updatedStandingsListener); |
|
|
this.sseService.unregisterEventHandler('season-standings.updated', this.updatedStandingsListener); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sortStandings(data:SeasonStanding[]) { |
|
|
|
|
|
let sorted = [...data] |
|
|
|
|
|
sorted.sort((a, b) => { |
|
|
|
|
|
return a.points - b.points |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.sortedStandings = [...sorted]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
onUpdatedStandings(data: any) { |
|
|
onUpdatedStandings(data: any) { |
|
|
if(this.season != undefined && data.seasonId != this.season.id){ |
|
|
if(this.season != undefined && data.seasonId != this.season.id){ |
|
|
return; |
|
|
return; |
|
|
@ -78,11 +87,7 @@ export class SeasonStandingsComponent { |
|
|
sorted.push(result) |
|
|
sorted.push(result) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
sorted.sort((a, b) => { |
|
|
this.sortStandings(sorted); |
|
|
return a.points - b.points |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.sortedStandings = [...sorted]; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getRacerName(racer: any): string { |
|
|
getRacerName(racer: any): string { |
|
|
|