Skip to content

Commit

Permalink
(fix) Fix search again
Browse files Browse the repository at this point in the history
  • Loading branch information
rrw-zilliqa committed Nov 25, 2024
1 parent d8551cd commit bc5d6a0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,9 @@ export const parseSearch = (q: string): string | undefined => {
// Tx hash?
if (isHexString(q, 32)) {
console.log(`search: this looks like a txn hash - ${q}`);
navigate(`/tx/${q}`);
return;
return `/tx/${q}`;
} else if (isHexString(`0x${q}`, 32)) {
navigate(`/tx/0x${q}`);
return;
return `/tx/0x${q}`;
}

// Zilliqa address?
Expand Down Expand Up @@ -345,8 +343,7 @@ export const parseSearch = (q: string): string | undefined => {
console.log(`search: try to parse ${toParse} as a block number`);
const blockNumber = BigInt(toParse);
console.log(`search: ${toParse} Parses as a block number ${blockNumber}`);
navigate(`/block/${blockNumber.toString()}`);
return;
return `/block/${blockNumber.toString()}`;
} catch (e) {
// Obviously not!
}
Expand All @@ -356,8 +353,7 @@ export const parseSearch = (q: string): string | undefined => {
const dsBlockNumber = parseInt(q.substring(1));
if (!isNaN(dsBlockNumber)) {
console.log(`search: # ${dsBlockNumber} - it's a ds block number`);
navigate(`/dsblock/${dsBlockNumber}`);
return;
return `/dsblock/${dsBlockNumber}`;
}
}

Expand Down

0 comments on commit bc5d6a0

Please sign in to comment.