Browse Source

Fixed the analysis page error when deleting benchmark

pull/2541/head
Basimohd 2 years ago
committed by Thomas
parent
commit
af5a7fed9d
  1. 22
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

22
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -385,12 +385,18 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
} }
private updateBenchmarkDataItems() { private updateBenchmarkDataItems() {
if (this.user.settings.benchmark) { this.benchmarkDataItems = [];
const { dataSource, symbol } = this.isLoadingBenchmarkComparator = false;
this.benchmarks.find(({ id }) => {
return id === this.user.settings.benchmark;
}) ?? {};
if (!this.user.settings.benchmark) return;
const { dataSource, symbol } =
this.benchmarks.find(({ id }) => {
return id === this.user.settings.benchmark;
}) ?? {};
if (dataSource && symbol) {
this.isLoadingBenchmarkComparator = true;
this.dataService this.dataService
.fetchBenchmarkBySymbol({ .fetchBenchmarkBySymbol({
dataSource, dataSource,
@ -407,13 +413,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
}); });
this.isLoadingBenchmarkComparator = false; this.isLoadingBenchmarkComparator = false;
this.changeDetectorRef.markForCheck();
}); });
} else {
this.benchmarkDataItems = [];
this.isLoadingBenchmarkComparator = false;
} }
} }
} }

Loading…
Cancel
Save