Fix for double subscribing to stats data.

This commit is contained in:
softsimon 2020-09-27 13:39:38 +07:00
parent 5536e5e77d
commit f4a78a0e78
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 4 additions and 3 deletions

View File

@ -36,7 +36,7 @@
<td> <td>
<h5 class="card-title">Unconfirmed</h5> <h5 class="card-title">Unconfirmed</h5>
<p class="card-text" *ngIf="mempoolInfoData.value; else loading"> <p class="card-text" *ngIf="mempoolInfoData.value; else loading">
{{ mempoolInfoData.value.memPoolInfo.size | number }} {{ mempoolInfoData.value.memPoolInfo.size | number }} txs
</p> </p>
</td> </td>
</tr> </tr>

View File

@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, Component, Inject, LOCALE_ID, OnInit } from '@angular/core'; import { ChangeDetectionStrategy, Component, Inject, LOCALE_ID, OnInit } from '@angular/core';
import { combineLatest, merge, Observable, of } from 'rxjs'; 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 { Block } from '../interfaces/electrs.interface';
import { OptimizedMempoolStats } from '../interfaces/node-api.interface'; import { OptimizedMempoolStats } from '../interfaces/node-api.interface';
import { MempoolInfo, TransactionStripped } from '../interfaces/websocket.interface'; import { MempoolInfo, TransactionStripped } from '../interfaces/websocket.interface';
@ -175,7 +175,8 @@ export class DashboardComponent implements OnInit {
mempool: mempoolStats, mempool: mempoolStats,
weightPerSecond: this.handleNewMempoolData(mempoolStats.concat([])), weightPerSecond: this.handleNewMempoolData(mempoolStats.concat([])),
}; };
}) }),
share(),
); );
this.transactionsWeightPerSecondOptions = { this.transactionsWeightPerSecondOptions = {