Fetch historical data based on timestamp and currency

This commit is contained in:
natsoni
2024-03-09 16:32:21 +01:00
parent 23076172e4
commit ccf1121f19
7 changed files with 100 additions and 29 deletions

View File

@@ -526,9 +526,9 @@ export class BlockComponent implements OnInit, OnDestroy {
if (this.priceSubscription) {
this.priceSubscription.unsubscribe();
}
this.priceSubscription = block$.pipe(
switchMap((block) => {
return this.priceService.getBlockPrice$(block.timestamp).pipe(
this.priceSubscription = combineLatest([this.stateService.fiatCurrency$, block$]).pipe(
switchMap(([currency, block]) => {
return this.priceService.getBlockPrice$(block.timestamp, true, currency).pipe(
tap((price) => {
this.blockConversion = price;
})