Browse Source

Fix standings

new_auth
Dan 2 years ago
parent
commit
d5165ad451
  1. 17
      packages/bridge-ui/src/app/components/season-standings/season-standings.component.ts

17
packages/bridge-ui/src/app/components/season-standings/season-standings.component.ts

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

Loading…
Cancel
Save