diff --git a/apps/client/src/app/components/home-market/home-market.component.ts b/apps/client/src/app/components/home-market/home-market.component.ts index af4ac2588..b738b7c69 100644 --- a/apps/client/src/app/components/home-market/home-market.component.ts +++ b/apps/client/src/app/components/home-market/home-market.component.ts @@ -20,7 +20,8 @@ import { CUSTOM_ELEMENTS_SCHEMA, DestroyRef, inject, - OnInit + OnInit, + signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { DeviceDetectorService } from 'ngx-device-detector'; @@ -37,7 +38,7 @@ import { DeviceDetectorService } from 'ngx-device-detector'; templateUrl: './home-market.html' }) export class GfHomeMarketComponent implements OnInit { - protected benchmarks: Benchmark[]; + protected readonly benchmarks = signal([]); protected readonly deviceType = computed( () => this.deviceDetectorService.deviceInfo().deviceType ); @@ -106,9 +107,7 @@ export class GfHomeMarketComponent implements OnInit { .fetchBenchmarks() .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ benchmarks }) => { - this.benchmarks = benchmarks; - - this.changeDetectorRef.markForCheck(); + this.benchmarks.set(benchmarks); }); } } diff --git a/apps/client/src/app/components/home-market/home-market.html b/apps/client/src/app/components/home-market/home-market.html index 08693f34b..0409f20bb 100644 --- a/apps/client/src/app/components/home-market/home-market.html +++ b/apps/client/src/app/components/home-market/home-market.html @@ -31,13 +31,13 @@
- @if (benchmarks?.length > 0) { + @if (benchmarks()?.length > 0) {