From 6de98dd52783206d4e8656fc8ea8d5385fb0788b Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sun, 31 May 2026 14:19:15 +0700 Subject: [PATCH] feat(client): replace deprecated getDeviceInfo --- .../pages/portfolio/analysis/analysis-page.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts index fea77a097..f16cb9325 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -27,6 +27,7 @@ import { Clipboard } from '@angular/cdk/clipboard'; import { ChangeDetectorRef, Component, + computed, DestroyRef, inject, OnInit, @@ -102,7 +103,9 @@ export class GfAnalysisPageComponent implements OnInit { protected user: User; private readonly actionsMenuButton = viewChild.required(MatMenuTrigger); - private deviceType: string; + private readonly deviceType = computed( + () => this.deviceDetectorService.deviceInfo().deviceType + ); private firstOrderDate: Date; private readonly changeDetectorRef = inject(ChangeDetectorRef); @@ -139,8 +142,6 @@ export class GfAnalysisPageComponent implements OnInit { } public ngOnInit() { - this.deviceType = this.deviceDetectorService.getDeviceInfo().deviceType; - this.impersonationStorageService .onChangeHasImpersonation() .pipe(takeUntilDestroyed(this.destroyRef)) @@ -333,7 +334,7 @@ export class GfAnalysisPageComponent implements OnInit { } if ( - this.deviceType === 'mobile' && + this.deviceType() === 'mobile' && this.performance.currentValueInBaseCurrency >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES ) {