fix tx search

pull/4524/head
yann300 9 months ago committed by Aniket
parent 7fa29c3e16
commit 4b974009b8
  1. 7
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx

@ -666,7 +666,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
) )
} else if (x.name === UNKNOWN_TRANSACTION) { } else if (x.name === UNKNOWN_TRANSACTION) {
return x.message return x.message
.filter((x) => x.tx.hash.includes(searchInput) || x.tx.from.includes(searchInput) || x.tx.to.includes(searchInput)) .filter((x) => x.tx.hash.includes(searchInput) || x.tx.from.includes(searchInput) || (x.tx.to && x.tx.to.includes(searchInput)))
.map((trans) => { .map((trans) => {
return ( return (
<div className={classNameBlock} data-id={`block_tx${trans.tx.hash}`} key={index}> <div className={classNameBlock} data-id={`block_tx${trans.tx.hash}`} key={index}>
@ -687,7 +687,9 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
) )
}) })
} else if (x.name === KNOWN_TRANSACTION) { } else if (x.name === KNOWN_TRANSACTION) {
return x.message.map((trans) => { return x.message
.filter((x) => x.tx.hash.includes(searchInput) || x.tx.from.includes(searchInput) || (x.tx.to && x.tx.to.includes(searchInput)))
.map((trans) => {
return ( return (
<div className={classNameBlock} data-id={`block_tx${trans.tx.hash}`} key={index}> <div className={classNameBlock} data-id={`block_tx${trans.tx.hash}`} key={index}>
{trans.tx.isCall ? ( {trans.tx.isCall ? (
@ -719,6 +721,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
) )
}) })
} else if (Array.isArray(x.message)) { } else if (Array.isArray(x.message)) {
if (searchInput !== '') return []
return x.message.map((msg, i) => { return x.message.map((msg, i) => {
// strictly check condition on 0, false, except undefined, NaN. // strictly check condition on 0, false, except undefined, NaN.
// if you type `undefined`, terminal automatically throws error, it's error message: "undefined" is not valid JSON // if you type `undefined`, terminal automatically throws error, it's error message: "undefined" is not valid JSON

Loading…
Cancel
Save