diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 25707b007..3e739a30f 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -453,12 +453,19 @@ -
-

Transaction not found.

-
Waiting for it to appear in the mempool...
+
+

Loading transaction

+ +
+

Transaction not found.

+
Waiting for it to appear in the mempool...
+
+
+
+

{{ error.error }}

diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index bbf679dcf..08f331e60 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -39,6 +39,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { isLoadingTx = true; error: any = undefined; errorUnblinded: any = undefined; + loadingCachedTx = false; waitingForTransaction = false; latestBlock: BlockExtended; transactionTime = -1; @@ -199,6 +200,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.fetchCachedTxSubscription = this.fetchCachedTx$ .pipe( + tap(() => { + this.loadingCachedTx = true; + }), switchMap((txId) => this.apiService .getRbfCachedTx$(txId) @@ -207,6 +211,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { return of(null); }) ).subscribe((tx) => { + this.loadingCachedTx = false; if (!tx) { return; } @@ -221,6 +226,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.tx.feePerVsize = tx.fee / (tx.weight / 4); this.isLoadingTx = false; this.error = undefined; + this.loadingCachedTx = false; this.waitingForTransaction = false; this.graphExpanded = false; this.transactionTime = tx.firstSeen || 0; @@ -338,6 +344,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.tx.feePerVsize = tx.fee / (tx.weight / 4); this.isLoadingTx = false; this.error = undefined; + this.loadingCachedTx = false; this.waitingForTransaction = false; this.websocketService.startTrackTransaction(tx.txid); this.graphExpanded = false; @@ -409,6 +416,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.txReplacedSubscription = this.stateService.txReplaced$.subscribe((rbfTransaction) => { if (!this.tx) { this.error = new Error(); + this.loadingCachedTx = false; this.waitingForTransaction = false; } this.rbfTransaction = rbfTransaction;