diff --git a/frontend/src/app/components/search-form/search-form.component.ts b/frontend/src/app/components/search-form/search-form.component.ts index 61807b674..e560076e7 100644 --- a/frontend/src/app/components/search-form/search-form.component.ts +++ b/frontend/src/app/components/search-form/search-form.component.ts @@ -25,7 +25,7 @@ export class SearchFormComponent implements OnInit { regexAddress = /^([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,100}|[A-Z]{2,5}1[AC-HJ-NP-Z02-9]{8,100})$/; regexBlockhash = /^[0]{8}[a-fA-F0-9]{56}$/; - regexTransaction = /^[a-fA-F0-9]{64}$/; + regexTransaction = /^([a-fA-F0-9]{64}):?(\d+)?$/; regexBlockheight = /^[0-9]+$/; @ViewChild('instance', {static: true}) instance: NgbTypeahead; @@ -100,22 +100,23 @@ export class SearchFormComponent implements OnInit { } else if (this.regexBlockhash.test(searchText) || this.regexBlockheight.test(searchText)) { this.navigate('/block/', searchText); } else if (this.regexTransaction.test(searchText)) { + const matches = this.regexTransaction.exec(searchText); if (this.network === 'liquid') { - if (this.assets[searchText]) { - this.navigate('/asset/', searchText); + if (this.assets[matches[1]]) { + this.navigate('/asset/', matches[1]); } - this.electrsApiService.getAsset$(searchText) + this.electrsApiService.getAsset$(matches[1]) .subscribe( - () => { this.navigate('/asset/', searchText); }, + () => { this.navigate('/asset/', matches[1]); }, () => { - this.electrsApiService.getBlock$(searchText) + this.electrsApiService.getBlock$(matches[1]) .subscribe( - (block) => { this.navigate('/block/', searchText, { state: { data: { block } } }); }, - () => { this.navigate('/tx/', searchText); }); + (block) => { this.navigate('/block/', matches[1], { state: { data: { block } } }); }, + () => { this.navigate('/tx/', matches[0]); }); } ); } else { - this.navigate('/tx/', searchText); + this.navigate('/tx/', matches[0]); } } else { this.isSearching = false; diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 96e118eb5..72aabd6cd 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -198,7 +198,7 @@
-{{ vout.scriptpubkey_address | shortenString : 16 }} @@ -197,7 +197,7 @@ | ||
diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.ts b/frontend/src/app/components/transactions-list/transactions-list.component.ts index 4425317c0..8cb62c104 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.ts +++ b/frontend/src/app/components/transactions-list/transactions-list.component.ts @@ -22,6 +22,7 @@ export class TransactionsListComponent implements OnInit, OnChanges { @Input() showConfirmations = false; @Input() transactionPage = false; @Input() errorUnblinded = false; + @Input() outputIndex: number; @Output() loadMore = new EventEmitter(); @@ -51,6 +52,14 @@ export class TransactionsListComponent implements OnInit, OnChanges { if (!this.transactions || !this.transactions.length) { return; } + if (this.outputIndex) { + setTimeout(() => { + const assetBoxElements = document.getElementsByClassName('assetBox'); + if (assetBoxElements && assetBoxElements[0]) { + assetBoxElements[0].scrollIntoView(); + } + }, 10); + } const observableObject = {}; this.transactions.forEach((tx, i) => { tx['@voutLimit'] = true; |