fix double decleration of errors

This commit is contained in:
HF 2021-03-17 20:53:57 +01:00
parent 0ba31b5c21
commit a4c0ead137

View File

@ -3,7 +3,7 @@
* @flow
*/
import React, {useState} from 'react';
import React, { useState } from 'react';
import { t } from 'ttag';
import { validatePassword } from '../utils/validation';
import { requestPasswordChange } from '../actions/fetch';
@ -48,13 +48,13 @@ const ChangePassword = ({ mailreg, done, cancel }) => {
onSubmit={async (e) => {
e.preventDefault();
if (submitting) return;
const errors = validate(
const valerrors = validate(
mailreg,
password,
newPassword,
confirmPassword,
);
setErrors(errors);
setErrors(valerrors);
if (errors.length) return;
setSubmitting(true);
const { errors: resperrors } = await requestPasswordChange(
@ -110,6 +110,6 @@ const ChangePassword = ({ mailreg, done, cancel }) => {
</form>
</div>
);
}
};
export default React.memo(ChangePassword);