ywana-core8 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.modern.js
CHANGED
@@ -1825,7 +1825,11 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
1825
1825
|
error = _useState3[0],
|
1826
1826
|
setError = _useState3[1];
|
1827
1827
|
useEffect(function () {
|
1828
|
-
|
1828
|
+
var _validate = validate(),
|
1829
|
+
valid = _validate[0],
|
1830
|
+
error = _validate[1];
|
1831
|
+
setIsValid(valid);
|
1832
|
+
setError(error);
|
1829
1833
|
}, [form.password1, form.password2, form.oldPassword]);
|
1830
1834
|
function validate() {
|
1831
1835
|
var hasRequiredUser = userRequired ? form.user && form.user.length > 0 : true;
|
@@ -1834,10 +1838,9 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
1834
1838
|
var _ref2 = hasPassword1 ? validatePassword(form.password1) : [false, "La contraseña es requerida."],
|
1835
1839
|
isValid = _ref2[0],
|
1836
1840
|
error = _ref2[1];
|
1837
|
-
setError(error);
|
1838
1841
|
var areEqual = form.password1 === form.password2;
|
1839
|
-
if (isValid && !areEqual)
|
1840
|
-
return hasRequiredUser && hasRequiredOldPwd && areEqual && isValid;
|
1842
|
+
if (isValid && !areEqual) error = "Las contraseñas no coinciden.";
|
1843
|
+
return [hasRequiredUser && hasRequiredOldPwd && areEqual && isValid, error];
|
1841
1844
|
}
|
1842
1845
|
function changeField(id, value) {
|
1843
1846
|
var _Object$assign;
|