Browse Source

feat(client): replace deprecated getDeviceInfo

pull/6926/head
KenTandrian 3 days ago
parent
commit
bbcb519c71
  1. 7
      apps/client/src/app/components/home-summary/home-summary.component.ts
  2. 2
      apps/client/src/app/components/home-summary/home-summary.html

7
apps/client/src/app/components/home-summary/home-summary.component.ts

@ -8,6 +8,7 @@ import { DataService } from '@ghostfolio/ui/services';
import { import {
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
computed,
CUSTOM_ELEMENTS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA,
DestroyRef, DestroyRef,
inject, inject,
@ -25,7 +26,9 @@ import { DeviceDetectorService } from 'ngx-device-detector';
templateUrl: './home-summary.html' templateUrl: './home-summary.html'
}) })
export class GfHomeSummaryComponent implements OnInit { export class GfHomeSummaryComponent implements OnInit {
protected deviceType: string; protected readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType
);
protected hasImpersonationId: boolean; protected hasImpersonationId: boolean;
protected hasPermissionToUpdateUserSettings: boolean; protected hasPermissionToUpdateUserSettings: boolean;
protected isLoading = true; protected isLoading = true;
@ -59,8 +62,6 @@ export class GfHomeSummaryComponent implements OnInit {
} }
public ngOnInit() { public ngOnInit() {
this.deviceType = this.deviceDetectorService.getDeviceInfo().deviceType;
this.impersonationStorageService this.impersonationStorageService
.onChangeHasImpersonation() .onChangeHasImpersonation()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))

2
apps/client/src/app/components/home-summary/home-summary.html

@ -6,7 +6,7 @@
<mat-card-content> <mat-card-content>
<gf-portfolio-summary <gf-portfolio-summary
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[deviceType]="deviceType" [deviceType]="deviceType()"
[hasImpersonationId]="hasImpersonationId" [hasImpersonationId]="hasImpersonationId"
[hasPermissionToUpdateUserSettings]=" [hasPermissionToUpdateUserSettings]="
!hasImpersonationId && hasPermissionToUpdateUserSettings !hasImpersonationId && hasPermissionToUpdateUserSettings

Loading…
Cancel
Save