Parse TXID, hash or address strings from search bar and allow searching for TXID:OUTPUT. (#578)

fixes #450
fixes #415
This commit is contained in:
softsimon
2021-07-06 19:43:18 +03:00
committed by GitHub
parent 1e9f131a2a
commit 2e2e6aa01f
5 changed files with 25 additions and 15 deletions

View File

@@ -198,7 +198,7 @@
<div class="clearfix"></div>
<app-transactions-list #txList [transactions]="[tx]" [transactionPage]="true"></app-transactions-list>
<app-transactions-list #txList [transactions]="[tx]" [outputIndex]="outputIndex" [transactionPage]="true"></app-transactions-list>
<h2 class="text-left" i18n="transaction.details">Details</h2>
<div class="box">

View File

@@ -20,6 +20,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
network = '';
tx: Transaction;
txId: string;
outputIndex: number;
txInBlockIndex: number;
isLoadingTx = true;
error: any = undefined;
@@ -75,9 +76,11 @@ export class TransactionComponent implements OnInit, OnDestroy {
this.subscription = this.route.paramMap.pipe(
switchMap((params: ParamMap) => {
this.txId = params.get('id') || '';
this.seoService.setTitle($localize`:@@bisq.transaction.browser-title:Transaction: ${this.txId}:INTERPOLATION:`);
this.resetTransaction();
const urlMatch = (params.get('id') || '').split(':');
this.txId = urlMatch[0];
this.outputIndex = urlMatch[1] === undefined ? null : parseInt(urlMatch[1], 10);
this.seoService.setTitle($localize`:@@bisq.transaction.browser-title:Transaction: ${this.txId}:INTERPOLATION:`);
return merge(
of(true),
this.stateService.connectionState$.pipe(
@@ -202,6 +205,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
resetTransaction() {
this.error = undefined;
this.tx = null;
this.outputIndex = null;
this.waitingForTransaction = false;
this.isLoadingTx = true;
this.rbfTransaction = undefined;