code cleanup, fix errors
This commit is contained in:
parent
8acce201d6
commit
222300ff17
8 changed files with 58 additions and 57 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue