fix saveSettings is currently being called even when validation fails.
This commit is contained in:
1 parent
3ce40b1ab8
commit
1c1ac25857
1 file changed
+1
-1
@@ -168,6 +168,7 @@ const Settings = () => {
|
|||||||
});
|
});
|
||||||
if (!error || error.details.length === 0) {
|
if (!error || error.details.length === 0) {
|
||||||
setErrors({});
|
setErrors({});
|
||||||
|
saveSettings(settingsData?.settings);
|
||||||
} else {
|
} else {
|
||||||
const newErrors = {};
|
const newErrors = {};
|
||||||
error.details.forEach((err) => {
|
error.details.forEach((err) => {
|
||||||
@@ -176,7 +177,6 @@ const Settings = () => {
|
|||||||
|
|
||||||
setErrors(newErrors);
|
setErrors(newErrors);
|
||||||
}
|
}
|
||||||
saveSettings(settingsData?.settings);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in new issue
Block a user