Skip to content

Commit 0a158b5

Browse files
fix: Add default value to custom nonce modal
1 parent fe5f85c commit 0a158b5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ui/components/app/modals/customize-nonce/customize-nonce.component.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const CustomizeNonce = ({
2727
updateCustomNonce,
2828
getNextNonce,
2929
}) => {
30-
const [customNonce, setCustomNonce] = useState('');
30+
const defaultNonce =
31+
customNonceValue || (typeof nextNonce === 'number' && nextNonce.toString());
32+
const [customNonce, setCustomNonce] = useState(defaultNonce);
3133
const t = useI18nContext();
3234

3335
return (
@@ -107,10 +109,7 @@ const CustomizeNonce = ({
107109
type="number"
108110
data-testid="custom-nonce-input"
109111
min="0"
110-
placeholder={
111-
customNonceValue ||
112-
(typeof nextNonce === 'number' && nextNonce.toString())
113-
}
112+
placeholder={defaultNonce}
114113
onChange={(e) => {
115114
setCustomNonce(e.target.value);
116115
}}

0 commit comments

Comments
 (0)