Nitpick fix - ref -
client/src/Pages/v1/Settings/index.jsx (1) 171-175: LGTM! The Redux dispatch provides immediate UI feedback while the actual persistence happens on Save. This is the correct pattern for a server-persisted setting. Minor note: The ?? value fallback is unreachable for showURL since newValue is always set to a boolean at line 96. Consider simplifying to dispatch(setShowURL(newValue)) for clarity, though the current code is functionally correct.
This commit is contained in:
1 parent
b6f48a910f
commit
a70959e4a6
1 file changed
+1
-5
@@ -171,11 +171,7 @@ const Settings = () => {
|
||||
|
||||
// Update Redux immediately for UI feedback
|
||||
if (name === "showURL") {
|
||||
dispatch(setShowURL(newValue ?? value));
|
||||
}
|
||||
};
|
||||
|
||||
const handleSave = () => {
|
||||
dispatch(setShowURL(newValue));
|
||||
const { error } = settingsValidation.validate(settingsData.settings, {
|
||||
abortEarly: false,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user