|
|
@ -64,26 +64,34 @@ export class GfBenchmarkDetailDialogComponent implements OnInit { |
|
|
symbol: this.data.symbol |
|
|
symbol: this.data.symbol |
|
|
}) |
|
|
}) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe(({ assetProfile, marketData }) => { |
|
|
.subscribe({ |
|
|
this.assetProfile = assetProfile; |
|
|
next: ({ assetProfile, marketData }) => { |
|
|
|
|
|
this.assetProfile = assetProfile; |
|
|
|
|
|
|
|
|
this.historicalDataItems = marketData.map( |
|
|
this.historicalDataItems = marketData.map( |
|
|
({ date, marketPrice }, index) => { |
|
|
({ date, marketPrice }, index) => { |
|
|
if (marketData.length - 1 === index) { |
|
|
if (marketData.length - 1 === index) { |
|
|
this.value = marketPrice; |
|
|
this.value = marketPrice; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
date: format(date, DATE_FORMAT), |
|
|
date: format(date, DATE_FORMAT), |
|
|
value: marketPrice |
|
|
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() { |
|
|
public onClose() { |
|
|
|