Skip to content

Commit

Permalink
fix event results not working if no starts in age group
Browse files Browse the repository at this point in the history
  • Loading branch information
konrad2002 committed Jun 8, 2024
1 parent 8c2fc35 commit 916707e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ <h1>{{'EVENT.PAGE.EVENT_TITLE_EVENT' | translate}} {{eventNumber}}<ng-container
{{'EVENT.PAGE.NO_STARTS_MESSAGE' | translate}}
</sr-no-content>
<sr-start-list
*ngIf="age.starts"
[starts]="age.starts"
[config]="config"
[fetching]="fetchingStarts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,17 @@ export class EventViewComponent implements OnInit, OnDestroy {
next: (data => {
this.resultStarts = [];
for (const age of data) {
age.starts = age.starts.sort((a,b) => {
const aS = new StartImpl(a);
const bS = new StartImpl(b);
if (aS.disqualification.reason) return 1;
if (bS.disqualification.reason) return -1;
if (!aS.getResultMilliseconds()) return 1;
if (!bS.getResultMilliseconds()) return -1;
return aS.getResultMilliseconds() - bS.getResultMilliseconds();
})
if (age.starts) {
age.starts = age.starts.sort((a, b) => {
const aS = new StartImpl(a);
const bS = new StartImpl(b);
if (aS.disqualification.reason) return 1;
if (bS.disqualification.reason) return -1;
if (!aS.getResultMilliseconds()) return 1;
if (!bS.getResultMilliseconds()) return -1;
return aS.getResultMilliseconds() - bS.getResultMilliseconds();
})
}
this.resultStarts.push(age)
}
this.fetchingStarts.fetching = false;
Expand Down

0 comments on commit 916707e

Please sign in to comment.