@hestia-earth/ui-components 0.12.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8709,9 +8709,14 @@ class ImpactAssessmentsGraphComponent {
8709
8709
  }
8710
8710
  ngOnChanges(changes) {
8711
8711
  if ('impactAssessments' in changes) {
8712
+ const selectedImpactAssessmentId = this.selectedImpactAssessmentId;
8712
8713
  this.initImpactAssessments();
8714
+ // only reload the chart if the select IA has changed
8715
+ selectedImpactAssessmentId !== this.selectedImpactAssessmentId && this.reloadChart();
8716
+ }
8717
+ if ('dataState' in changes) {
8718
+ return this.reloadChart();
8713
8719
  }
8714
- return this.reloadChart();
8715
8720
  }
8716
8721
  initImpactAssessments() {
8717
8722
  this.filteredImpactAssessments = this.impactAssessments.filter((ia) => ia.endpoints?.length || ia.impacts?.length);
@@ -8738,6 +8743,9 @@ class ImpactAssessmentsGraphComponent {
8738
8743
  return this.dataState === DataState.recalculated;
8739
8744
  }
8740
8745
  reloadChart() {
8746
+ if (!this.isRecalculated) {
8747
+ return;
8748
+ }
8741
8749
  const impactAssessment = this.filteredImpactAssessments.find((ia) => ia['@id'] === this.selectedImpactAssessmentId) ||
8742
8750
  this.filteredImpactAssessments[0];
8743
8751
  const indicators = [