Another bugfix related to the mempool transaction subscription.

This commit is contained in:
softsimon 2020-04-13 02:43:43 +07:00
parent 590f1d2b04
commit e02924e8dd
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 5 additions and 2 deletions

View File

@ -56,7 +56,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
), ),
); );
}), }),
flatMap(() => { switchMap(() => {
let transactionObservable$: Observable<Transaction>; let transactionObservable$: Observable<Transaction>;
if (history.state.data) { if (history.state.data) {
transactionObservable$ = of(history.state.data); transactionObservable$ = of(history.state.data);

View File

@ -129,6 +129,9 @@ export class WebsocketService {
} }
startTrackTransaction(txId: string) { startTrackTransaction(txId: string) {
if (this.isTrackingTx) {
return;
}
this.websocketSubject.next({ 'track-tx': txId }); this.websocketSubject.next({ 'track-tx': txId });
this.isTrackingTx = true; this.isTrackingTx = true;
} }
@ -139,7 +142,7 @@ export class WebsocketService {
} }
stopTrackingTransaction() { stopTrackingTransaction() {
if (this.isTrackingTx === false) { if (!this.isTrackingTx) {
return; return;
} }
this.websocketSubject.next({ 'track-tx': 'stop' }); this.websocketSubject.next({ 'track-tx': 'stop' });