From f4a78a0e78a33c32e3313911e74118c96a7aed5d Mon Sep 17 00:00:00 2001 From: softsimon Date: Sun, 27 Sep 2020 13:39:38 +0700 Subject: [PATCH] Fix for double subscribing to stats data. --- frontend/src/app/dashboard/dashboard.component.html | 2 +- frontend/src/app/dashboard/dashboard.component.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/dashboard/dashboard.component.html b/frontend/src/app/dashboard/dashboard.component.html index e603f69d4..1efd71a2d 100644 --- a/frontend/src/app/dashboard/dashboard.component.html +++ b/frontend/src/app/dashboard/dashboard.component.html @@ -36,7 +36,7 @@
Unconfirmed

- {{ mempoolInfoData.value.memPoolInfo.size | number }} + {{ mempoolInfoData.value.memPoolInfo.size | number }} txs

diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index fdfab299d..26460d754 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Inject, LOCALE_ID, OnInit } from '@angular/core'; import { combineLatest, merge, Observable, of } from 'rxjs'; -import { map, scan, switchMap, take, tap } from 'rxjs/operators'; +import { map, scan, share, switchMap, tap } from 'rxjs/operators'; import { Block } from '../interfaces/electrs.interface'; import { OptimizedMempoolStats } from '../interfaces/node-api.interface'; import { MempoolInfo, TransactionStripped } from '../interfaces/websocket.interface'; @@ -175,7 +175,8 @@ export class DashboardComponent implements OnInit { mempool: mempoolStats, weightPerSecond: this.handleNewMempoolData(mempoolStats.concat([])), }; - }) + }), + share(), ); this.transactionsWeightPerSecondOptions = {