Browse Source

make selection persistent

pull/5570/head
Batwam 1 month ago
parent
commit
a043f3afc5
No known key found for this signature in database GPG Key ID: 7D9EDF6264938D38
  1. 8
      apps/client/src/app/components/home-overview/home-overview.component.ts

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

@ -61,7 +61,7 @@ export class GfHomeOverviewComponent implements OnDestroy, OnInit {
public showDetails = false;
public unit: string;
public user: User;
private graph_type: string = 'netPerformanceInPercentageWithCurrencyEffect';
private graph_type: string;
public graph_unit: string;
private unsubscribeSubject = new Subject<void>();
@ -99,6 +99,11 @@ export class GfHomeOverviewComponent implements OnDestroy, OnInit {
this.unit = this.showDetails ? this.user.settings.baseCurrency : '%';
this.graph_type = !this.showDetails
? 'netPerformanceInPercentageWithCurrencyEffect'
: (localStorage.getItem('home_overview_graph_type') ??
'netPerformanceInPercentageWithCurrencyEffect');
this.impersonationStorageService
.onChangeHasImpersonation()
.pipe(takeUntil(this.unsubscribeSubject))
@ -168,6 +173,7 @@ export class GfHomeOverviewComponent implements OnDestroy, OnInit {
public onMetricClick(selectedgraph_type: string): void {
if (this.graph_type !== selectedgraph_type) {
this.graph_type = selectedgraph_type;
localStorage.setItem('home_overview_graph_type', this.graph_type);
this.update();
}
}

Loading…
Cancel
Save