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() {
if (this.user.settings.benchmark) {
const { dataSource, symbol } =
this.benchmarks.find(({ id }) => {
return id === this.user.settings.benchmark;
}) ?? {};
this.benchmarkDataItems = [];
this.isLoadingBenchmarkComparator = false;
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
.fetchBenchmarkBySymbol({
dataSource,
@ -407,13 +413,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
});
this.isLoadingBenchmarkComparator = false;
this.changeDetectorRef.markForCheck();
});
} else {
this.benchmarkDataItems = [];
this.isLoadingBenchmarkComparator = false;
}
}
}

Loading…
Cancel
Save