diff --git a/CHANGELOG.md b/CHANGELOG.md index f8b050cdb..a7d161fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed an issue with the calculation of the projected total amount in the _FIRE_ calculator +- Fixed an issue with the loading state of the _FIRE_ calculator ## 1.135.0 - 10.04.2022 diff --git a/libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts b/libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts index cce5727a8..6a451d20b 100644 --- a/libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts +++ b/libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts @@ -7,8 +7,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { baseCurrency, locale } from '@ghostfolio/common/config'; import { Meta, Story, moduleMetadata } from '@storybook/angular'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; -import { GfValueModule } from '../value'; +import { GfValueModule } from '../value'; import { FireCalculatorComponent } from './fire-calculator.component'; import { FireCalculatorService } from './fire-calculator.service'; diff --git a/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts b/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts index 50132f4f5..b8c2c6141 100644 --- a/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts +++ b/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts @@ -12,6 +12,7 @@ import { } from '@angular/core'; import { FormBuilder, FormControl } from '@angular/forms'; import { primaryColorRgb, secondaryColorRgb } from '@ghostfolio/common/config'; +import { transformTickToAbbreviation } from '@ghostfolio/common/helper'; import { BarController, BarElement, @@ -20,10 +21,10 @@ import { LinearScale, Tooltip } from 'chart.js'; +import { isNumber } from 'lodash'; +import { Subject, takeUntil } from 'rxjs'; import { FireCalculatorService } from './fire-calculator.service'; -import { Subject, takeUntil } from 'rxjs'; -import { transformTickToAbbreviation } from '@ghostfolio/common/helper'; @Component({ selector: 'gf-fire-calculator', @@ -84,7 +85,7 @@ export class FireCalculatorComponent } public ngAfterViewInit() { - if (this.fireWealth >= 0) { + if (isNumber(this.fireWealth) && this.fireWealth >= 0) { setTimeout(() => { // Wait for the chartCanvas this.calculatorForm.patchValue({ @@ -98,7 +99,7 @@ export class FireCalculatorComponent } public ngOnChanges() { - if (this.fireWealth >= 0) { + if (isNumber(this.fireWealth) && this.fireWealth >= 0) { setTimeout(() => { // Wait for the chartCanvas this.calculatorForm.patchValue({