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 28bfd251e..da1378d22 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 @@ -48,8 +48,8 @@ export class GfFirePageComponent implements OnDestroy, OnInit { public safeWithdrawalRateOptions = [0.025, 0.03, 0.035, 0.04, 0.045]; public user: User; public withdrawalRatePerMonth: Big; - public withdrawalRatePerYear: Big; public withdrawalRatePerMonthProjected: Big; + public withdrawalRatePerYear: Big; public withdrawalRatePerYearProjected: Big; private unsubscribeSubject = new Subject(); @@ -145,6 +145,18 @@ export class GfFirePageComponent implements OnDestroy, OnInit { }); } + public onCalculationComplete({ + projectedTotalAmount, + retirementDate + }: FireCalculationCompleteEvent) { + this.projectedTotalAmount = projectedTotalAmount; + this.retirementDate = retirementDate; + + this.calculateWithdrawalRatesProjected(); + + this.isLoading = false; + } + public onRetirementDateChange(retirementDate: Date) { this.dataService .putUserSetting({ @@ -176,7 +188,7 @@ export class GfFirePageComponent implements OnDestroy, OnInit { this.user = user; this.calculateWithdrawalRates(); - this.calculateProjectedWithdrawalRates(); + this.calculateWithdrawalRatesProjected(); this.changeDetectorRef.markForCheck(); }); @@ -218,18 +230,6 @@ export class GfFirePageComponent implements OnDestroy, OnInit { }); } - public onCalculationComplete({ - projectedTotalAmount, - retirementDate - }: FireCalculationCompleteEvent) { - this.projectedTotalAmount = projectedTotalAmount; - this.retirementDate = retirementDate; - - this.calculateProjectedWithdrawalRates(); - - this.isLoading = false; - } - public ngOnDestroy() { this.unsubscribeSubject.next(); this.unsubscribeSubject.complete(); @@ -245,7 +245,7 @@ export class GfFirePageComponent implements OnDestroy, OnInit { } } - private calculateProjectedWithdrawalRates() { + private calculateWithdrawalRatesProjected() { if ( this.fireWealth && this.projectedTotalAmount && diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.html b/apps/client/src/app/pages/portfolio/fire/fire-page.html index def8e98c7..a4a17fa86 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.html +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.html @@ -63,7 +63,7 @@ } @else {
-
+
If you retire today, you would be able to withdraw @@ -135,55 +135,58 @@ }
-
- By -   - {{ - user?.settings?.retirementDate ?? retirementDate | date: 'MMMM yyyy' - }} - , -   - this is projected to increase to -   - + @if (user?.settings?.isExperimentalFeatures) { +
+ By   - per year -   - or -   - + {{ + user?.settings?.retirementDate ?? retirementDate + | date: 'MMMM yyyy' + }} + ,   - per month, -   - assuming a -   - -   - annual interest rate. -
+ this is projected to increase to +   + +   + per year +   + or +   + +   + per month, +   + assuming a +   + +   + annual interest rate. +
+ }
}
diff --git a/libs/common/src/lib/interfaces/fire-calculation.interface.ts b/libs/common/src/lib/interfaces/fire-calculation-complete-event.interface.ts similarity index 100% rename from libs/common/src/lib/interfaces/fire-calculation.interface.ts rename to libs/common/src/lib/interfaces/fire-calculation-complete-event.interface.ts diff --git a/libs/common/src/lib/interfaces/index.ts b/libs/common/src/lib/interfaces/index.ts index 1b54c49ca..4b8e8009a 100644 --- a/libs/common/src/lib/interfaces/index.ts +++ b/libs/common/src/lib/interfaces/index.ts @@ -18,7 +18,7 @@ import type { DataProviderInfo } from './data-provider-info.interface'; import type { EnhancedSymbolProfile } from './enhanced-symbol-profile.interface'; import type { FilterGroup } from './filter-group.interface'; import type { Filter } from './filter.interface'; -import type { FireCalculationCompleteEvent } from './fire-calculation.interface'; +import type { FireCalculationCompleteEvent } from './fire-calculation-complete-event.interface'; import type { FireWealth } from './fire-wealth.interface'; import type { HistoricalDataItem } from './historical-data-item.interface'; import type { HoldingWithParents } from './holding-with-parents.interface';