diff --git a/libs/ui/src/lib/benchmark/benchmark.component.html b/libs/ui/src/lib/benchmark/benchmark.component.html index 29aebc75c..b11a76507 100644 --- a/libs/ui/src/lib/benchmark/benchmark.component.html +++ b/libs/ui/src/lib/benchmark/benchmark.component.html @@ -3,9 +3,9 @@ class="gf-table w-100" mat-table matSort + matSortActive="name" + matSortDirection="asc" [dataSource]="dataSource" - [matSortActive]="sortColumn" - [matSortDirection]="sortDirection" > @@ -102,9 +102,9 @@ Change from All Time High(); @@ -106,22 +101,12 @@ export class GfBenchmarkComponent }); } - ngAfterViewInit() { - this.dataSource.sort = this.sort; - - this.dataSource.sortingDataAccessor = (item, property) => { - switch (property) { - case 'change': - return item.performances?.allTimeHigh?.performancePercent; - default: - return get(item, property); - } - }; - } - public ngOnChanges() { if (this.benchmarks) { this.dataSource.data = this.benchmarks; + this.dataSource.sort = this.sort; + this.dataSource.sortingDataAccessor = get; + this.isLoading = false; }