Browse Source
#3955 Make constructor public and handle empty emergency fund input
If negative, fallback to defaultValue.
If empty/user deletes entry, fallback to 0.
pull/4117/head
Brandon Wortman
8 months ago
No known key found for this signature in database
GPG Key ID: C63DB7DA05AEC086
1 changed files with
3 additions and
2 deletions
-
apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts
|
|
@ -35,7 +35,7 @@ export class PortfolioSummaryComponent implements OnChanges { |
|
|
|
); |
|
|
|
public timeInMarket: string; |
|
|
|
|
|
|
|
constructor(private notificationService: NotificationService) {} |
|
|
|
public constructor(private notificationService: NotificationService) {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
if (this.summary) { |
|
|
@ -54,7 +54,8 @@ export class PortfolioSummaryComponent implements OnChanges { |
|
|
|
public onEditEmergencyFund() { |
|
|
|
this.notificationService.prompt({ |
|
|
|
confirmFn: (value) => { |
|
|
|
const emergencyFund = parseFloat(value.trim()); |
|
|
|
// If empty/deleted value by user, default to 0.
|
|
|
|
const emergencyFund = parseFloat(value.trim()) || 0; |
|
|
|
if (emergencyFund >= 0) { |
|
|
|
this.emergencyFundChanged.emit(emergencyFund); |
|
|
|
} |
|
|
|