From b4d0e20d7545b382dfc8915a85041bc4f3ee6587 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Fri, 24 Feb 2023 12:12:50 +0900 Subject: [PATCH] Only query historical price if we're running mempool BASE_MODULE --- frontend/src/app/services/price.service.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/services/price.service.ts b/frontend/src/app/services/price.service.ts index 8a93d9554..e3ec93c8b 100644 --- a/frontend/src/app/services/price.service.ts +++ b/frontend/src/app/services/price.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; import { map, Observable, of, share, shareReplay, tap } from 'rxjs'; import { ApiService } from './api.service'; +import { StateService } from './state.service'; // nodejs backend interfaces export interface ApiPrice { @@ -52,7 +53,8 @@ export class PriceService { }; constructor( - private apiService: ApiService + private apiService: ApiService, + private stateService: StateService ) { } @@ -68,6 +70,10 @@ export class PriceService { } getBlockPrice$(blockTimestamp: number, singlePrice = false): Observable { + if (this.stateService.env.BASE_MODULE !== 'mempool') { + return of(undefined); + } + const now = new Date().getTime() / 1000; /**