From e02924e8dda4127f35dfc23110c4302f6bbd2a2e Mon Sep 17 00:00:00 2001 From: softsimon Date: Mon, 13 Apr 2020 02:43:43 +0700 Subject: [PATCH] Another bugfix related to the mempool transaction subscription. --- .../src/app/components/transaction/transaction.component.ts | 2 +- frontend/src/app/services/websocket.service.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 412a865d4..78eacbed6 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -56,7 +56,7 @@ export class TransactionComponent implements OnInit, OnDestroy { ), ); }), - flatMap(() => { + switchMap(() => { let transactionObservable$: Observable; if (history.state.data) { transactionObservable$ = of(history.state.data); diff --git a/frontend/src/app/services/websocket.service.ts b/frontend/src/app/services/websocket.service.ts index a64a35bc0..34d14c1e0 100644 --- a/frontend/src/app/services/websocket.service.ts +++ b/frontend/src/app/services/websocket.service.ts @@ -129,6 +129,9 @@ export class WebsocketService { } startTrackTransaction(txId: string) { + if (this.isTrackingTx) { + return; + } this.websocketSubject.next({ 'track-tx': txId }); this.isTrackingTx = true; } @@ -139,7 +142,7 @@ export class WebsocketService { } stopTrackingTransaction() { - if (this.isTrackingTx === false) { + if (!this.isTrackingTx) { return; } this.websocketSubject.next({ 'track-tx': 'stop' });