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

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

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

Loading…
Cancel
Save