From 07245753e2ad896b2c078c29446aa7ad976ba5f5 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sat, 23 May 2026 15:52:58 +0700 Subject: [PATCH] feat(client): replace deprecated getDeviceInfo --- .../home-overview/home-overview.component.ts | 10 ++++++---- .../app/components/home-overview/home-overview.html | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/client/src/app/components/home-overview/home-overview.component.ts b/apps/client/src/app/components/home-overview/home-overview.component.ts index b3999a36d..3a5d5b29c 100644 --- a/apps/client/src/app/components/home-overview/home-overview.component.ts +++ b/apps/client/src/app/components/home-overview/home-overview.component.ts @@ -21,6 +21,7 @@ import { DataService } from '@ghostfolio/ui/services'; import { ChangeDetectorRef, Component, + computed, DestroyRef, inject, OnInit @@ -42,7 +43,10 @@ import { DeviceDetectorService } from 'ngx-device-detector'; templateUrl: './home-overview.html' }) export class GfHomeOverviewComponent implements OnInit { - protected deviceType: string; + protected readonly deviceType = computed( + () => this.deviceDetectorService.deviceInfo().deviceType + ); + protected errors: AssetProfileIdentifier[]; protected hasImpersonationId: boolean; protected hasPermissionToCreateActivity: boolean; @@ -87,8 +91,6 @@ export class GfHomeOverviewComponent implements OnInit { } public ngOnInit() { - this.deviceType = this.deviceDetectorService.getDeviceInfo().deviceType; - this.showDetails = !this.user.settings.isRestrictedView && this.user.settings.viewMode !== 'ZEN'; @@ -137,7 +139,7 @@ export class GfHomeOverviewComponent implements OnInit { ) ?? null; if ( - this.deviceType === 'mobile' && + this.deviceType() === 'mobile' && this.performance.currentValueInBaseCurrency >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES ) { diff --git a/apps/client/src/app/components/home-overview/home-overview.html b/apps/client/src/app/components/home-overview/home-overview.html index 7c740f7e1..69c8eb35c 100644 --- a/apps/client/src/app/components/home-overview/home-overview.html +++ b/apps/client/src/app/components/home-overview/home-overview.html @@ -67,7 +67,7 @@