Browse Source

feat(client): change worldMapChartFormat to getter

pull/7076/head
KenTandrian 4 weeks ago
parent
commit
71a5328cd5
  1. 11
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

11
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

@ -118,7 +118,6 @@ export class GfAllocationsPageComponent implements OnInit {
protected topHoldings: HoldingWithParents[];
protected readonly UNKNOWN_KEY = UNKNOWN_KEY;
protected user: User;
protected worldMapChartFormat: string;
private topHoldingsMap: {
[name: string]: { name: string; value: number };
@ -147,6 +146,12 @@ export class GfAllocationsPageComponent implements OnInit {
});
}
protected get worldMapChartFormat(): string {
return this.showValuesInPercentage()
? '{0}%'
: `{0} ${this.user?.settings?.baseCurrency}`;
}
public ngOnInit() {
this.impersonationStorageService
.onChangeHasImpersonation()
@ -161,10 +166,6 @@ export class GfAllocationsPageComponent implements OnInit {
if (state?.user) {
this.user = state.user;
this.worldMapChartFormat = this.showValuesInPercentage()
? `{0}%`
: `{0} ${this.user?.settings?.baseCurrency}`;
this.isLoading = true;
this.initialize();

Loading…
Cancel
Save