Skip to content

Commit

Permalink
Merge pull request #897 from blockscout/bugfix/token-verification
Browse files Browse the repository at this point in the history
bugfix: token verification QA
  • Loading branch information
tom2drum authored Jun 13, 2023
2 parents 60090f2 + 5be2b13 commit d2260d2
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit d2260d2

Please sign in to comment.