Browse Source

feat(client): convert errors to signal

pull/6927/head
KenTandrian 2 days ago
parent
commit
20655f1774
  1. 7
      apps/client/src/app/components/home-overview/home-overview.component.ts
  2. 2
      apps/client/src/app/components/home-overview/home-overview.html

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

@ -24,7 +24,8 @@ import {
computed, computed,
DestroyRef, DestroyRef,
inject, inject,
OnInit OnInit,
signal
} from '@angular/core'; } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
@ -47,7 +48,7 @@ export class GfHomeOverviewComponent implements OnInit {
() => this.deviceDetectorService.deviceInfo().deviceType () => this.deviceDetectorService.deviceInfo().deviceType
); );
protected errors: AssetProfileIdentifier[]; protected readonly errors = signal<AssetProfileIdentifier[]>([]);
protected hasImpersonationId: boolean; protected hasImpersonationId: boolean;
protected hasPermissionToCreateActivity: boolean; protected hasPermissionToCreateActivity: boolean;
protected historicalDataItems: LineChartItem[] | null; protected historicalDataItems: LineChartItem[] | null;
@ -125,7 +126,7 @@ export class GfHomeOverviewComponent implements OnInit {
}) })
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ chart, errors, performance }) => { .subscribe(({ chart, errors, performance }) => {
this.errors = errors ?? []; this.errors.set(errors ?? []);
this.performance = performance; this.performance = performance;
this.historicalDataItems = this.historicalDataItems =

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

@ -87,7 +87,7 @@
<gf-portfolio-performance <gf-portfolio-performance
class="pb-4" class="pb-4"
[deviceType]="deviceType()" [deviceType]="deviceType()"
[errors]="errors" [errors]="errors()"
[isLoading]="isLoadingPerformance" [isLoading]="isLoadingPerformance"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
[performance]="performance" [performance]="performance"

Loading…
Cancel
Save