Fix handleSave function syntax errors

This commit is contained in:
Craig Lawson
2026-01-11 22:48:17 +00:00
parent 1494df9eb3
commit 3ce40b1ab8
2 changed files with 1212 additions and 493 deletions
+1203 -475
View File
File diff suppressed because it is too large Load Diff
+9 -18
View File
@@ -153,29 +153,20 @@ const Settings = () => {
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);
// Update Redux immediately for UI feedback
if (name === "showURL") {
dispatch(setShowURL(newValue));
}
};
dispatch(setShowURL(newValue));
}
};
const handleSave = () => {
const handleSave = () => {
// Validate
const { error } = settingsValidation.validate(settingsData.settings, {
abortEarly: false,
});
if (!error || error.details.length === 0) {
setErrors({});
} else {
const newErrors = {};