diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
index 5110536ed3..7935f5699b 100644
--- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
+++ b/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) {
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) => {
return (
@@ -687,7 +687,9 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
)
})
} 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 (
{trans.tx.isCall ? (
@@ -719,6 +721,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
)
})
} else if (Array.isArray(x.message)) {
+ if (searchInput !== '') return []
return x.message.map((msg, i) => {
// 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