Skip to content

Commit

Permalink
fixed uncaught in promise timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
superolegatron committed Oct 1, 2024
1 parent 18943c2 commit 6fcc1c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions FrontEnd/src/pages/SignUp/SignupForm/SignUpFormContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function SignUpFormContentComponent(props) {
const [showPassword, setShowPassword] = useState(false);
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
const reCaptchaRef = useRef();
const onReCaptchaChange = () => reCaptchaRef.current = !reCaptchaRef.current;
const toggleConfirmPassword = () => {
setShowConfirmPassword(!showConfirmPassword);
};
Expand Down Expand Up @@ -164,9 +165,6 @@ export function SignUpFormContentComponent(props) {
if (error.response && error.response.status === 400) {
toast.error('Не вдалося зареєструвати користувача, сталася помилка');
}
})
.finally(()=>{
reCaptchaRef.current?.reset();
});
};

Expand Down Expand Up @@ -560,6 +558,7 @@ export function SignUpFormContentComponent(props) {
ref={reCaptchaRef}
sitekey={process.env.REACT_APP_RECAPTCHA_V2_SITE_KEY}
size="invisible"
onChange={onReCaptchaChange}
/>
</form>
<Suspense fallback={<div>Loading...</div>}>
Expand Down

0 comments on commit 6fcc1c1

Please sign in to comment.