Commit 5be2b135 authored by tom's avatar tom

reset form error when button is clicked again

parent 2ae0217f
......@@ -94,20 +94,25 @@ const AddressVerificationStepSignature = ({ address, signingMessage, contractCre
}, [ clearErrors ]);
const handleOpenWeb3Modal = React.useCallback(() => {
clearErrors('root');
openWeb3Modal();
}, [ openWeb3Modal ]);
}, [ clearErrors, openWeb3Modal ]);
const handleWeb3SignClick = React.useCallback(() => {
clearErrors('root');
if (!isConnected) {
return setError('root', { type: 'manual', message: 'Please connect to your Web3 wallet first' });
}
const message = getValues('message');
signMessage({ message });
}, [ getValues, signMessage, isConnected, setError ]);
}, [ clearErrors, isConnected, getValues, signMessage, setError ]);
const handleManualSignClick = React.useCallback(() => {
clearErrors('root');
onSubmit();
}, [ onSubmit ]);
}, [ clearErrors, onSubmit ]);
const button = (() => {
if (signMethod === 'manually') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment