Browse Source

feat(client): replaced deprecated getDeviceInfo

pull/6746/head
KenTandrian 4 days ago
parent
commit
b9097df3ed
  1. 10
      apps/client/src/app/pages/public/public-page.component.ts
  2. 4
      apps/client/src/app/pages/public/public-page.html

10
apps/client/src/app/pages/public/public-page.component.ts

@ -19,6 +19,7 @@ import { HttpErrorResponse } from '@angular/common/http';
import {
ChangeDetectorRef,
Component,
computed,
CUSTOM_ELEMENTS_SCHEMA,
DestroyRef,
inject,
@ -61,7 +62,6 @@ export class GfPublicPageComponent implements OnInit {
[code: string]: { name: string; value: number };
};
public defaultAlias = $localize`someone`;
public deviceType: string;
public hasPermissionForSubscription: boolean;
public holdings: PublicPortfolioResponse['holdings'][string][];
public info: InfoItem;
@ -86,11 +86,15 @@ export class GfPublicPageComponent implements OnInit {
};
public UNKNOWN_KEY = UNKNOWN_KEY;
protected readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType
);
private readonly activatedRoute = inject(ActivatedRoute);
private readonly changeDetectorRef = inject(ChangeDetectorRef);
private readonly dataService = inject(DataService);
private readonly destroyRef = inject(DestroyRef);
private readonly deviceService = inject(DeviceDetectorService);
private readonly deviceDetectorService = inject(DeviceDetectorService);
private readonly router = inject(Router);
private accessId: string;
@ -109,8 +113,6 @@ export class GfPublicPageComponent implements OnInit {
}
public ngOnInit() {
this.deviceType = this.deviceService.getDeviceInfo().deviceType;
this.dataService
.fetchPublicPortfolio(this.accessId)
.pipe(

4
apps/client/src/app/pages/public/public-page.html

@ -75,7 +75,7 @@
[data]="symbols"
[isInPercentage]="true"
[keys]="['symbol']"
[showLabels]="deviceType !== 'mobile'"
[showLabels]="deviceType() !== 'mobile'"
/>
<gf-holdings-table
[hasPermissionToOpenDetails]="false"
@ -213,7 +213,7 @@
<mat-card-content>
<gf-activities-table
[dataSource]="latestActivitiesDataSource"
[deviceType]="deviceType"
[deviceType]="deviceType()"
[hasPermissionToCreateActivity]="false"
[hasPermissionToDeleteActivity]="false"
[hasPermissionToExportActivities]="false"

Loading…
Cancel
Save