code cleanup, fix errors

This commit is contained in:
Matthew Penner 2021-09-12 15:56:47 -06:00
parent 8acce201d6
commit 222300ff17
No known key found for this signature in database
GPG key ID: 030E4AB751DC756F
8 changed files with 58 additions and 57 deletions

View file

@ -18,18 +18,18 @@ interface Values {
}
export default () => {
const ref = useRef<Reaptcha>(null);
const ref = useRef<Reaptcha | null>(null);
const [ token, setToken ] = useState('');
const { clearFlashes, addFlash } = useFlash();
const { enabled: recaptchaEnabled, siteKey } = useStoreState(state => state.settings.data!.recaptcha);
useEffect(() => {
clearFlashes();
clearFlashes(undefined);
}, []);
const handleSubmission = ({ email }: Values, { setSubmitting, resetForm }: FormikHelpers<Values>) => {
clearFlashes();
clearFlashes(undefined);
// If there is no token in the state yet, request the token and then abort this submit request
// since it will be re-submitted when the recaptcha data is returned by the component.