diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts index ec038139b..61ee39027 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts @@ -178,6 +178,7 @@ export class GfFirePageComponent implements OnDestroy, OnInit { this.user = user; this.calculateWithdrawalRates(); + this.calculateProjectedWithdrawalRates(); this.changeDetectorRef.markForCheck(); }); @@ -221,19 +222,7 @@ export class GfFirePageComponent implements OnDestroy, OnInit { public onCalculationComplete(calculation: FireCalculation) { this.fireCalculation = calculation; - - if ( - this.fireWealth && - this.user?.settings?.safeWithdrawalRate && - calculation.projectedTotalAmount - ) { - this.projectedWithdrawalRatePerYear = new Big( - calculation.projectedTotalAmount - ).mul(this.user.settings.safeWithdrawalRate); - - this.projectedWithdrawalRatePerMonth = - this.projectedWithdrawalRatePerYear.div(12); - } + this.calculateProjectedWithdrawalRates(); } public ngOnDestroy() { @@ -250,4 +239,19 @@ export class GfFirePageComponent implements OnDestroy, OnInit { this.withdrawalRatePerMonth = this.withdrawalRatePerYear.div(12); } } + + private calculateProjectedWithdrawalRates() { + if ( + this.fireWealth && + this.user?.settings?.safeWithdrawalRate && + this.fireCalculation.projectedTotalAmount + ) { + this.projectedWithdrawalRatePerYear = new Big( + this.fireCalculation.projectedTotalAmount + ).mul(this.user.settings.safeWithdrawalRate); + + this.projectedWithdrawalRatePerMonth = + this.projectedWithdrawalRatePerYear.div(12); + } + } }