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 d345cb1e0..bcd5afb53 100644 --- a/frontend/src/app/components/search-form/search-form.component.ts +++ b/frontend/src/app/components/search-form/search-form.component.ts @@ -195,6 +195,7 @@ export class SearchFormComponent implements OnInit { const matchesTxId = this.regexTransaction.test(searchText) && !this.regexBlockhash.test(searchText); const matchesBlockHash = this.regexBlockhash.test(searchText); const matchesAddress = !matchesTxId && this.regexAddress.test(searchText); + const publicKey = matchesAddress && searchText.startsWith('0'); const otherNetworks = findOtherNetworks(searchText, this.network as any || 'mainnet', this.env); const liquidAsset = this.assets ? (this.assets[searchText] || []) : []; const pools = this.pools.filter(pool => pool["name"].toLowerCase().includes(searchText.toLowerCase())).slice(0, 10); @@ -203,6 +204,10 @@ export class SearchFormComponent implements OnInit { searchText = searchText.replace(/\//g, '-'); } + if (publicKey) { + otherNetworks.length = 0; + } + return { searchText: searchText, hashQuickMatch: +(matchesBlockHeight || matchesBlockHash || matchesTxId || matchesAddress || matchesUnixTimestamp || matchesDateTime), @@ -212,6 +217,7 @@ export class SearchFormComponent implements OnInit { txId: matchesTxId, blockHash: matchesBlockHash, address: matchesAddress, + publicKey: publicKey, addresses: matchesAddress && addressPrefixSearchResults.length === 1 && searchText === addressPrefixSearchResults[0] ? [] : addressPrefixSearchResults, // If there is only one address and it matches the search text, don't show it in the dropdown otherNetworks: otherNetworks, nodes: lightningResults.nodes, diff --git a/frontend/src/app/components/search-form/search-results/search-results.component.html b/frontend/src/app/components/search-form/search-results/search-results.component.html index 35ce2a0a7..e5db07670 100644 --- a/frontend/src/app/components/search-form/search-results/search-results.component.html +++ b/frontend/src/app/components/search-form/search-results/search-results.component.html @@ -23,7 +23,7 @@ - + {{ networkName }} Address @@ -35,26 +35,26 @@ - - Other Network Address - - - ({{ otherNetwork.network.charAt(0).toUpperCase() + otherNetwork.network.slice(1) }}) - - - {{ networkName }} Addresses - + + + Mining Pools + + + + + + Lightning Nodes - + {{ node.public_key | shortenString : 10 }} @@ -62,19 +62,25 @@ Lightning Channels - + {{ channel.id }} - - Mining Pools - - - + + Other Network Address + + + ({{ otherNetwork.network.charAt(0).toUpperCase() + otherNetwork.network.slice(1) }}) + + {{ networkName }} Address + + + + Liquid Asset diff --git a/frontend/src/app/components/search-form/search-results/search-results.component.ts b/frontend/src/app/components/search-form/search-results/search-results.component.ts index 31fcc2819..082f24b13 100644 --- a/frontend/src/app/components/search-form/search-results/search-results.component.ts +++ b/frontend/src/app/components/search-form/search-results/search-results.component.ts @@ -27,7 +27,7 @@ export class SearchResultsComponent implements OnChanges { ngOnChanges() { this.activeIdx = 0; if (this.results) { - this.resultsFlattened = [...(this.results.hashQuickMatch ? [this.results.searchText] : []), ...this.results.otherNetworks, ...this.results.addresses, ...this.results.nodes, ...this.results.channels, ...this.results.pools]; + this.resultsFlattened = [...(this.results.hashQuickMatch ? [this.results.searchText] : []), ...this.results.addresses, ...this.results.pools, ...this.results.nodes, ...this.results.channels, ...this.results.otherNetworks]; } }