- Error loading transaction data.
-
-
{{ error.error }}
+
+
+
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 dd904727a..a85b93fc4 100644
--- a/frontend/src/app/components/transaction/transaction.component.ts
+++ b/frontend/src/app/components/transaction/transaction.component.ts
@@ -1,9 +1,9 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ElectrsApiService } from '../../services/electrs-api.service';
import { ActivatedRoute, ParamMap } from '@angular/router';
-import { switchMap, filter, take } from 'rxjs/operators';
+import { switchMap, filter, take, catchError, mergeMap, flatMap, mergeAll, tap, map } from 'rxjs/operators';
import { Transaction, Block } from '../../interfaces/electrs.interface';
-import { of, merge, Subscription } from 'rxjs';
+import { of, merge, Subscription, Observable, scheduled } from 'rxjs';
import { StateService } from '../../services/state.service';
import { WebsocketService } from '../../services/websocket.service';
import { AudioService } from 'src/app/services/audio.service';
@@ -26,6 +26,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
txInBlockIndex: number;
isLoadingTx = true;
error: any = undefined;
+ waitingForTransaction = false;
latestBlock: Block;
transactionTime = -1;
subscription: Subscription;
@@ -47,35 +48,47 @@ export class TransactionComponent implements OnInit, OnDestroy {
switchMap((params: ParamMap) => {
this.txId = params.get('id') || '';
this.seoService.setTitle('Transaction: ' + this.txId, true);
- this.error = undefined;
- this.feeRating = undefined;
- this.isLoadingTx = true;
- this.transactionTime = -1;
- document.body.scrollTo(0, 0);
- this.leaveTransaction();
+ this.resetTransaction();
return merge(
of(true),
- this.stateService.connectionState$
- .pipe(filter((state) => state === 2 && this.tx && !this.tx.status.confirmed) ),
- )
- .pipe(
- switchMap(() => {
- if (history.state.data) {
- return of(history.state.data);
- }
- return this.electrsApiService.getTransaction$(this.txId);
- })
+ this.stateService.connectionState$.pipe(
+ filter((state) => state === 2 && this.tx && !this.tx.status.confirmed)
+ ),
+ );
+ }),
+ flatMap(() => {
+ let transactionObservable$: Observable