From 4d84aa0e357096f914758f0a4d971240c5364889 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Fri, 22 May 2026 12:01:01 +0700 Subject: [PATCH] feat(client): convert fearAndGreedIndex to signal --- .../src/app/components/home-market/home-market.component.ts | 6 ++---- apps/client/src/app/components/home-market/home-market.html | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) 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 c3c128deb..dd0c38cea 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 @@ -42,7 +42,7 @@ export class GfHomeMarketComponent implements OnInit { protected readonly deviceType = computed( () => this.deviceDetectorService.deviceInfo().deviceType ); - protected fearAndGreedIndex: number; + protected readonly fearAndGreedIndex = signal(undefined); protected readonly fearLabel = $localize`Fear`; protected readonly greedLabel = $localize`Greed`; protected hasPermissionToAccessFearAndGreedIndex: boolean; @@ -90,7 +90,7 @@ export class GfHomeMarketComponent implements OnInit { }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ historicalData, marketPrice }) => { - this.fearAndGreedIndex = marketPrice; + this.fearAndGreedIndex.set(marketPrice); this.historicalDataItems.set([ ...historicalData, { @@ -98,8 +98,6 @@ export class GfHomeMarketComponent implements OnInit { value: marketPrice } ]); - - this.changeDetectorRef.markForCheck(); }); } 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 2d8e71343..a782526ee 100644 --- a/apps/client/src/app/components/home-market/home-market.html +++ b/apps/client/src/app/components/home-market/home-market.html @@ -22,7 +22,7 @@ />