Exclude date and timestamp results for non-bitcoin networks
This commit is contained in:
parent
dd31d5a665
commit
b9776263dc
@ -177,9 +177,12 @@ export class SearchFormComponent implements OnInit {
|
|||||||
const addressPrefixSearchResults = result[0];
|
const addressPrefixSearchResults = result[0];
|
||||||
const lightningResults = result[1];
|
const lightningResults = result[1];
|
||||||
|
|
||||||
|
// Do not show date and timestamp results for liquid and bisq
|
||||||
|
const isNetworkBitcoin = this.network === '' || this.network === 'testnet' || this.network === 'signet';
|
||||||
|
|
||||||
const matchesBlockHeight = this.regexBlockheight.test(searchText) && parseInt(searchText) <= this.stateService.latestBlockHeight;
|
const matchesBlockHeight = this.regexBlockheight.test(searchText) && parseInt(searchText) <= this.stateService.latestBlockHeight;
|
||||||
const matchesDateTime = this.regexDate.test(searchText) && new Date(searchText).toString() !== 'Invalid Date' && new Date(searchText).getTime() <= Date.now() && new Date(searchText).getTime() >= 1231006505000;
|
const matchesDateTime = this.regexDate.test(searchText) && new Date(searchText).toString() !== 'Invalid Date' && new Date(searchText).getTime() <= Date.now() && isNetworkBitcoin;
|
||||||
const matchesUnixTimestamp = this.regexUnixTimestamp.test(searchText) && parseInt(searchText) <= Math.floor(Date.now() / 1000) && parseInt(searchText) >= 1231006505; // 1231006505 is the timestamp of the genesis block
|
const matchesUnixTimestamp = this.regexUnixTimestamp.test(searchText) && parseInt(searchText) <= Math.floor(Date.now() / 1000) && isNetworkBitcoin;
|
||||||
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);
|
||||||
let matchesAddress = !matchesTxId && this.regexAddress.test(searchText);
|
let matchesAddress = !matchesTxId && this.regexAddress.test(searchText);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user