mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-19 07:58:46 -05:00
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:
@@ -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