Browse Source

feat(client): replace deprecated getDeviceInfo

pull/6921/head
KenTandrian 4 days ago
parent
commit
09bc0f16d4
  1. 6
      apps/client/src/app/components/home-market/home-market.component.ts
  2. 2
      apps/client/src/app/components/home-market/home-market.html

6
apps/client/src/app/components/home-market/home-market.component.ts

@ -16,6 +16,7 @@ import { DataService } from '@ghostfolio/ui/services';
import {
ChangeDetectorRef,
Component,
computed,
CUSTOM_ELEMENTS_SCHEMA,
DestroyRef,
inject,
@ -37,7 +38,9 @@ import { DeviceDetectorService } from 'ngx-device-detector';
})
export class GfHomeMarketComponent implements OnInit {
protected benchmarks: Benchmark[];
protected readonly deviceType: string;
protected readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType
);
protected fearAndGreedIndex: number;
protected readonly fearLabel = $localize`Fear`;
protected readonly greedLabel = $localize`Greed`;
@ -55,7 +58,6 @@ export class GfHomeMarketComponent implements OnInit {
private readonly userService = inject(UserService);
public constructor() {
this.deviceType = this.deviceDetectorService.getDeviceInfo().deviceType;
this.info = this.dataService.fetchInfo();
this.userService.stateChanged

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

@ -32,7 +32,7 @@
<div class="col-xs-12 col-md-10 offset-md-1">
<gf-benchmark
[benchmarks]="benchmarks"
[deviceType]="deviceType"
[deviceType]="deviceType()"
[locale]="user?.settings?.locale || undefined"
[showSymbol]="false"
[user]="user"

Loading…
Cancel
Save