Bugfix/fix loading state in fire calculator (#824)

* Fix loading state

* Update changelog
This commit is contained in:
Thomas Kaul 2022-04-12 19:57:23 +02:00 committed by GitHub
parent aef91d3e30
commit 500e09d95a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed an issue with the calculation of the projected total amount in the _FIRE_ calculator - 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 ## 1.135.0 - 10.04.2022

View File

@ -7,8 +7,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { baseCurrency, locale } from '@ghostfolio/common/config'; import { baseCurrency, locale } from '@ghostfolio/common/config';
import { Meta, Story, moduleMetadata } from '@storybook/angular'; import { Meta, Story, moduleMetadata } from '@storybook/angular';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { GfValueModule } from '../value';
import { GfValueModule } from '../value';
import { FireCalculatorComponent } from './fire-calculator.component'; import { FireCalculatorComponent } from './fire-calculator.component';
import { FireCalculatorService } from './fire-calculator.service'; import { FireCalculatorService } from './fire-calculator.service';

View File

@ -12,6 +12,7 @@ import {
} from '@angular/core'; } from '@angular/core';
import { FormBuilder, FormControl } from '@angular/forms'; import { FormBuilder, FormControl } from '@angular/forms';
import { primaryColorRgb, secondaryColorRgb } from '@ghostfolio/common/config'; import { primaryColorRgb, secondaryColorRgb } from '@ghostfolio/common/config';
import { transformTickToAbbreviation } from '@ghostfolio/common/helper';
import { import {
BarController, BarController,
BarElement, BarElement,
@ -20,10 +21,10 @@ import {
LinearScale, LinearScale,
Tooltip Tooltip
} from 'chart.js'; } from 'chart.js';
import { isNumber } from 'lodash';
import { Subject, takeUntil } from 'rxjs';
import { FireCalculatorService } from './fire-calculator.service'; import { FireCalculatorService } from './fire-calculator.service';
import { Subject, takeUntil } from 'rxjs';
import { transformTickToAbbreviation } from '@ghostfolio/common/helper';
@Component({ @Component({
selector: 'gf-fire-calculator', selector: 'gf-fire-calculator',
@ -84,7 +85,7 @@ export class FireCalculatorComponent
} }
public ngAfterViewInit() { public ngAfterViewInit() {
if (this.fireWealth >= 0) { if (isNumber(this.fireWealth) && this.fireWealth >= 0) {
setTimeout(() => { setTimeout(() => {
// Wait for the chartCanvas // Wait for the chartCanvas
this.calculatorForm.patchValue({ this.calculatorForm.patchValue({
@ -98,7 +99,7 @@ export class FireCalculatorComponent
} }
public ngOnChanges() { public ngOnChanges() {
if (this.fireWealth >= 0) { if (isNumber(this.fireWealth) && this.fireWealth >= 0) {
setTimeout(() => { setTimeout(() => {
// Wait for the chartCanvas // Wait for the chartCanvas
this.calculatorForm.patchValue({ this.calculatorForm.patchValue({