fix double decleration of errors
This commit is contained in:
parent
0ba31b5c21
commit
a4c0ead137
|
@ -3,7 +3,7 @@
|
||||||
* @flow
|
* @flow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {useState} from 'react';
|
import React, { useState } from 'react';
|
||||||
import { t } from 'ttag';
|
import { t } from 'ttag';
|
||||||
import { validatePassword } from '../utils/validation';
|
import { validatePassword } from '../utils/validation';
|
||||||
import { requestPasswordChange } from '../actions/fetch';
|
import { requestPasswordChange } from '../actions/fetch';
|
||||||
|
@ -48,13 +48,13 @@ const ChangePassword = ({ mailreg, done, cancel }) => {
|
||||||
onSubmit={async (e) => {
|
onSubmit={async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (submitting) return;
|
if (submitting) return;
|
||||||
const errors = validate(
|
const valerrors = validate(
|
||||||
mailreg,
|
mailreg,
|
||||||
password,
|
password,
|
||||||
newPassword,
|
newPassword,
|
||||||
confirmPassword,
|
confirmPassword,
|
||||||
);
|
);
|
||||||
setErrors(errors);
|
setErrors(valerrors);
|
||||||
if (errors.length) return;
|
if (errors.length) return;
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
const { errors: resperrors } = await requestPasswordChange(
|
const { errors: resperrors } = await requestPasswordChange(
|
||||||
|
@ -110,6 +110,6 @@ const ChangePassword = ({ mailreg, done, cancel }) => {
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default React.memo(ChangePassword);
|
export default React.memo(ChangePassword);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user