From 266c347292ffc43b86209be85d9043b69c01a609 Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 29 Jul 2020 15:20:23 +0700 Subject: [PATCH] Fee box: Handle empty mempool. --- frontend/src/app/components/fees-box/fees-box.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/fees-box/fees-box.component.ts b/frontend/src/app/components/fees-box/fees-box.component.ts index 67c5daff3..c55c164a8 100644 --- a/frontend/src/app/components/fees-box/fees-box.component.ts +++ b/frontend/src/app/components/fees-box/fees-box.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; import { StateService } from 'src/app/services/state.service'; -import { map } from 'rxjs/operators'; +import { map, filter } from 'rxjs/operators'; import { Observable } from 'rxjs'; interface FeeEstimations { @@ -25,6 +25,7 @@ export class FeesBoxComponent implements OnInit { ngOnInit(): void { this.feeEstimations$ = this.stateService.mempoolBlocks$ .pipe( + filter((blocks) => !!blocks.length), map((pBlocks) => { let firstMedianFee = Math.ceil(pBlocks[0].medianFee);