Skip to content

Commit a6d9a26

Browse files
committed
Fix warnings.
Signed-off-by: bgravenorst <[email protected]>
1 parent 6275648 commit a6d9a26

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ export const BaseInputTemplate = ({
5858
}
5959
}, [value, isFormReseted, currentFormData])
6060

61+
// RJSF uses lowercase "autofocus"; React expects camelCase "autoFocus".
62+
// Extract it so we can map correctly and avoid passing an invalid DOM prop.
63+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
64+
const { autofocus, ...inputRest } = rest
65+
6166
return (
6267
<div className={isArray ? styles.arrayItemRow : styles.tableRow}>
6368
{!isArray && (
@@ -99,7 +104,8 @@ export const BaseInputTemplate = ({
99104
setIsFocused(false)
100105
onBlur?.(id, inputValue)
101106
}}
102-
{...rest}
107+
autoFocus={autofocus}
108+
{...inputRest}
103109
/>
104110
<span className={styles.tableColumnType}>
105111
{schema.type}

src/components/ParserOpenRPC/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP
5656
[currentNetwork, method]
5757
)
5858

59-
// Bail early if we failed to find the requested network or method.
60-
if (!currentNetwork || !currentMethod) {
61-
console.error('ParserOpenRPC: network or method not found', { network, method })
62-
return null
63-
}
59+
const dataReady = currentNetwork && currentMethod
6460

6561
const [isModalOpen, setModalOpen] = useState(false)
6662
const [reqResult, setReqResult] = useState(undefined)
@@ -149,7 +145,9 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP
149145
}
150146
}, [currentNetwork, method, currentMethod, userEncPublicKey])
151147

152-
if (currentMethodData === null) return null
148+
if (!dataReady || currentMethodData === null) {
149+
return null
150+
}
153151

154152
const isMetamaskNetwork = network === NETWORK_NAMES.metamask
155153

0 commit comments

Comments
 (0)