Fix txids interpreted as addresses in search
This commit is contained in:
parent
3b4dd7e633
commit
abbaee0274
@ -153,7 +153,7 @@ export class SearchFormComponent implements OnInit {
|
|||||||
const matchesBlockHeight = this.regexBlockheight.test(searchText);
|
const matchesBlockHeight = this.regexBlockheight.test(searchText);
|
||||||
const matchesTxId = this.regexTransaction.test(searchText) && !this.regexBlockhash.test(searchText);
|
const matchesTxId = this.regexTransaction.test(searchText) && !this.regexBlockhash.test(searchText);
|
||||||
const matchesBlockHash = this.regexBlockhash.test(searchText);
|
const matchesBlockHash = this.regexBlockhash.test(searchText);
|
||||||
const matchesAddress = this.regexAddress.test(searchText);
|
const matchesAddress = !matchesTxId && this.regexAddress.test(searchText);
|
||||||
|
|
||||||
if (matchesAddress && this.network === 'bisq') {
|
if (matchesAddress && this.network === 'bisq') {
|
||||||
searchText = 'B' + searchText;
|
searchText = 'B' + searchText;
|
||||||
@ -198,7 +198,7 @@ export class SearchFormComponent implements OnInit {
|
|||||||
const searchText = result || this.searchForm.value.searchText.trim();
|
const searchText = result || this.searchForm.value.searchText.trim();
|
||||||
if (searchText) {
|
if (searchText) {
|
||||||
this.isSearching = true;
|
this.isSearching = true;
|
||||||
if (this.regexAddress.test(searchText)) {
|
if (!this.regexTransaction.test(searchText) && this.regexAddress.test(searchText)) {
|
||||||
this.navigate('/address/', searchText);
|
this.navigate('/address/', searchText);
|
||||||
} else if (this.regexBlockhash.test(searchText) || this.regexBlockheight.test(searchText)) {
|
} else if (this.regexBlockhash.test(searchText) || this.regexBlockheight.test(searchText)) {
|
||||||
this.navigate('/block/', searchText);
|
this.navigate('/block/', searchText);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user