Fix handleSave function syntax errors

This commit is contained in:
Craig Lawson committed 2026-01-11 22:48:17 +00:00
1 parent 1494df9eb3
commit 3ce40b1ab8
2 files changed
+1207 -488

No files matched your search

+1202 -474
View File
File diff suppressed because it is too large. Load diff
+5 -14
View File
@@ -153,20 +153,6 @@ const Settings = () => {
return; return;
} }
// Validate
const { error } = settingsValidation.validate(newSettingsData.settings, {
abortEarly: false,
});
if (!error || error.details.length === 0) {
setErrors({});
} else {
const newErrors = {};
error.details.forEach((err) => {
newErrors[err.path[0]] = err.message;
});
setErrors(newErrors);
}
setSettingsData(newSettingsData); setSettingsData(newSettingsData);
// Update Redux immediately for UI feedback // Update Redux immediately for UI feedback
@@ -176,6 +162,11 @@ const Settings = () => {
}; };
const handleSave = () => { const handleSave = () => {
// Validate
const { error } = settingsValidation.validate(settingsData.settings, {
abortEarly: false,
});
if (!error || error.details.length === 0) {
setErrors({}); setErrors({});
} else { } else {
const newErrors = {}; const newErrors = {};