Shreya 4 days ago
committed by GitHub
parent
commit
6d11200b3f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 40
      libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.component.ts

40
libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.component.ts

@ -64,26 +64,34 @@ export class GfBenchmarkDetailDialogComponent implements OnInit {
symbol: this.data.symbol
})
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ assetProfile, marketData }) => {
this.assetProfile = assetProfile;
.subscribe({
next: ({ assetProfile, marketData }) => {
this.assetProfile = assetProfile;
this.historicalDataItems = marketData.map(
({ date, marketPrice }, index) => {
if (marketData.length - 1 === index) {
this.value = marketPrice;
}
this.historicalDataItems = marketData.map(
({ date, marketPrice }, index) => {
if (marketData.length - 1 === index) {
this.value = marketPrice;
}
return {
date: format(date, DATE_FORMAT),
value: marketPrice
};
}
);
return {
date: format(date, DATE_FORMAT),
value: marketPrice
};
}
);
this.isLoading = false;
this.isLoading = false;
this.changeDetectorRef.markForCheck();
});
this.changeDetectorRef.markForCheck();
},
error: () => {
this.historicalDataItems = [];
this.isLoading = false;
this.changeDetectorRef.markForCheck();
}
});
}
public onClose() {

Loading…
Cancel
Save