Transaction tracking revamped.

Blockchain block arrow.
This commit is contained in:
Simon Lindh
2020-02-19 23:50:23 +07:00
committed by wiz
parent 34645908e9
commit f3cfa038d3
15 changed files with 232 additions and 145 deletions

View File

@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ElectrsApiService } from '../../services/electrs-api.service';
import { ActivatedRoute, ParamMap } from '@angular/router';
import { switchMap } from 'rxjs/operators';
@@ -12,7 +12,7 @@ import { WebsocketService } from '../../services/websocket.service';
templateUrl: './transaction.component.html',
styleUrls: ['./transaction.component.scss']
})
export class TransactionComponent implements OnInit {
export class TransactionComponent implements OnInit, OnDestroy {
tx: Transaction;
txId: string;
isLoadingTx = true;
@@ -51,7 +51,7 @@ export class TransactionComponent implements OnInit {
window.scrollTo(0, 0);
if (!tx.status.confirmed) {
this.websocketService.startTrackTx(tx.txid);
this.websocketService.startTrackTransaction(tx.txid);
}
},
(error) => {
@@ -75,4 +75,8 @@ export class TransactionComponent implements OnInit {
};
});
}
ngOnDestroy() {
this.websocketService.startTrackTransaction('stop');
}
}