From 09bc0f16d421c07d881b32d4005b0b1dfa341ee1 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Fri, 22 May 2026 10:57:12 +0700 Subject: [PATCH] feat(client): replace deprecated getDeviceInfo --- .../src/app/components/home-market/home-market.component.ts | 6 ++++-- apps/client/src/app/components/home-market/home-market.html | 2 +- 2 files changed, 5 insertions(+), 3 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 02c3d7197..af4ac2588 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 @@ -16,6 +16,7 @@ import { DataService } from '@ghostfolio/ui/services'; import { ChangeDetectorRef, Component, + computed, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, inject, @@ -37,7 +38,9 @@ import { DeviceDetectorService } from 'ngx-device-detector'; }) export class GfHomeMarketComponent implements OnInit { protected benchmarks: Benchmark[]; - protected readonly deviceType: string; + protected readonly deviceType = computed( + () => this.deviceDetectorService.deviceInfo().deviceType + ); protected fearAndGreedIndex: number; protected readonly fearLabel = $localize`Fear`; protected readonly greedLabel = $localize`Greed`; @@ -55,7 +58,6 @@ export class GfHomeMarketComponent implements OnInit { private readonly userService = inject(UserService); public constructor() { - this.deviceType = this.deviceDetectorService.getDeviceInfo().deviceType; this.info = this.dataService.fetchInfo(); this.userService.stateChanged 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 fc7230d35..08693f34b 100644 --- a/apps/client/src/app/components/home-market/home-market.html +++ b/apps/client/src/app/components/home-market/home-market.html @@ -32,7 +32,7 @@