From b1fa3e25ba47d903f1b9a2420b2791ad2ec9c98e Mon Sep 17 00:00:00 2001 From: PJ Date: Wed, 18 Nov 2026 21:09:25 +0100 Subject: [PATCH] fix(targets): correct account typing and stable chart inputs --- .../targets/target-configuration-dialog.component.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.ts b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.ts index d96444d5b7..b12d391493 100644 --- a/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.ts @@ -37,7 +37,7 @@ export class GfTargetConfigurationDialogComponent { protected readonly presets = TARGET_PRESETS; protected profile: PortfolioTargetProfile; - private readonly data = inject<{ + protected readonly data = inject<{ profile?: PortfolioTargetProfile; user: User; }>(MAT_DIALOG_DATA); @@ -54,10 +54,13 @@ export class GfTargetConfigurationDialogComponent { ...(this.data.profile ?? defaultProfile), allocations: { ...(this.data.profile?.allocations ?? defaultProfile.allocations) } }; + this.updateChartData(); } - protected get chartData() { - return Object.fromEntries(this.classes.map((assetClass) => [ + protected chartData: Record = {}; + + private updateChartData() { + this.chartData = Object.fromEntries(this.classes.map((assetClass) => [ assetClass, { name: this.labels[assetClass], @@ -87,6 +90,7 @@ export class GfTargetConfigurationDialogComponent { ...next, tolerance: this.profile.tolerance }; + this.updateChartData(); } protected updateAllocation(assetClass: AssetClass, percent: number) { @@ -98,6 +102,7 @@ export class GfTargetConfigurationDialogComponent { [assetClass]: Number(percent) / 100 } }; + this.updateChartData(); } protected updateTolerance(percent: number) {