mirror of
https://github.com/mempool/mempool.git
synced 2024-11-20 10:21:52 +01:00
Merge pull request #2995 from mempool/simon/bisq-search-bar-fix
Bisq markets search bar fix
This commit is contained in:
commit
027603acf7
@ -107,7 +107,13 @@ export class SearchFormComponent implements OnInit {
|
||||
}))),
|
||||
);
|
||||
}),
|
||||
tap((result: any[]) => {
|
||||
map((result: any[]) => {
|
||||
if (this.network === 'bisq') {
|
||||
result[0] = result[0].map((address: string) => 'B' + address);
|
||||
}
|
||||
return result;
|
||||
}),
|
||||
tap(() => {
|
||||
this.isTypeaheading$.next(false);
|
||||
})
|
||||
);
|
||||
@ -126,7 +132,7 @@ export class SearchFormComponent implements OnInit {
|
||||
]
|
||||
).pipe(
|
||||
map((latestData) => {
|
||||
const searchText = latestData[0];
|
||||
let searchText = latestData[0];
|
||||
if (!searchText.length) {
|
||||
return {
|
||||
searchText: '',
|
||||
@ -144,15 +150,15 @@ export class SearchFormComponent implements OnInit {
|
||||
const addressPrefixSearchResults = result[0];
|
||||
const lightningResults = result[1];
|
||||
|
||||
if (this.network === 'bisq') {
|
||||
return searchText.map((address: string) => 'B' + address);
|
||||
}
|
||||
|
||||
const matchesBlockHeight = this.regexBlockheight.test(searchText);
|
||||
const matchesTxId = this.regexTransaction.test(searchText) && !this.regexBlockhash.test(searchText);
|
||||
const matchesBlockHash = this.regexBlockhash.test(searchText);
|
||||
const matchesAddress = this.regexAddress.test(searchText);
|
||||
|
||||
if (matchesAddress && this.network === 'bisq') {
|
||||
searchText = 'B' + searchText;
|
||||
}
|
||||
|
||||
return {
|
||||
searchText: searchText,
|
||||
hashQuickMatch: +(matchesBlockHeight || matchesBlockHash || matchesTxId || matchesAddress),
|
||||
|
Loading…
Reference in New Issue
Block a user