#366: properly handle the case, when password confirmation is succeed, but parent form has errors

This commit is contained in:
SleepWalker 2017-11-19 22:33:03 +02:00
parent 4afbbd0efb
commit 957bed17c6

View File

@ -125,7 +125,11 @@ export default connect(null, {
if (resp.errors) {
form.setErrors(resp.errors);
if (Object.keys(resp.errors).length > 1) {
const parentFormHasErrors = Object.keys(resp.errors)
.filter((name) => name !== 'password')
.length > 0;
if (parentFormHasErrors) {
// something wrong with parent form, hidding popup and show that form
props.onClose();
reject(resp);