Browse Source

feat(client): replace deprecated getDeviceInfo

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

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

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

Loading…
Cancel
Save