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' });