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 ...@@ -94,20 +94,25 @@ const AddressVerificationStepSignature = ({ address, signingMessage, contractCre
}, [ clearErrors ]); }, [ clearErrors ]);
const handleOpenWeb3Modal = React.useCallback(() => { const handleOpenWeb3Modal = React.useCallback(() => {
clearErrors('root');
openWeb3Modal(); openWeb3Modal();
}, [ openWeb3Modal ]); }, [ clearErrors, openWeb3Modal ]);
const handleWeb3SignClick = React.useCallback(() => { const handleWeb3SignClick = React.useCallback(() => {
clearErrors('root');
if (!isConnected) { if (!isConnected) {
return setError('root', { type: 'manual', message: 'Please connect to your Web3 wallet first' }); return setError('root', { type: 'manual', message: 'Please connect to your Web3 wallet first' });
} }
const message = getValues('message'); const message = getValues('message');
signMessage({ message }); signMessage({ message });
}, [ getValues, signMessage, isConnected, setError ]); }, [ clearErrors, isConnected, getValues, signMessage, setError ]);
const handleManualSignClick = React.useCallback(() => { const handleManualSignClick = React.useCallback(() => {
clearErrors('root');
onSubmit(); onSubmit();
}, [ onSubmit ]); }, [ clearErrors, onSubmit ]);
const button = (() => { const button = (() => {
if (signMethod === 'manually') { 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