Merge pull request #3185 from mempool/nymkappa/historical-frontend-price-flag

Add frontend config flag to toggle historical price fetching
This commit is contained in:
softsimon
2023-03-02 15:32:57 +09:00
committed by GitHub
4 changed files with 7 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ export class PriceService {
}
getBlockPrice$(blockTimestamp: number, singlePrice = false): Observable<Price | undefined> {
if (this.stateService.env.BASE_MODULE !== 'mempool') {
if (this.stateService.env.BASE_MODULE !== 'mempool' || !this.stateService.env.HISTORICAL_PRICE) {
return of(undefined);
}

View File

@@ -43,6 +43,7 @@ export interface Env {
MAINNET_BLOCK_AUDIT_START_HEIGHT: number;
TESTNET_BLOCK_AUDIT_START_HEIGHT: number;
SIGNET_BLOCK_AUDIT_START_HEIGHT: number;
HISTORICAL_PRICE: boolean;
}
const defaultEnv: Env = {
@@ -72,6 +73,7 @@ const defaultEnv: Env = {
'MAINNET_BLOCK_AUDIT_START_HEIGHT': 0,
'TESTNET_BLOCK_AUDIT_START_HEIGHT': 0,
'SIGNET_BLOCK_AUDIT_START_HEIGHT': 0,
'HISTORICAL_PRICE': true,
};
@Injectable({