diff --git a/client/src/Pages/Settings/index.jsx b/client/src/Pages/Settings/index.jsx index 68df9a180..a600e7cec 100644 --- a/client/src/Pages/Settings/index.jsx +++ b/client/src/Pages/Settings/index.jsx @@ -55,7 +55,6 @@ const Settings = () => { trigger, getValues, setValue, - formState: { dirtyFields }, } = form; useEffect(() => { reset(defaults, { keepDirtyValues: false }); @@ -103,25 +102,6 @@ const Settings = () => { }) ); - // Handle password field: - // - If emailPasswordHasBeenReset is true, ALWAYS include (even if empty to unset) - // - Otherwise, only include if dirty (user typed something) - if (emailPasswordHasBeenReset) { - // Keep password field (even if empty) to allow unsetting - // toSubmit.systemEmailPassword is already in toSubmit - } else if (!form.formState.dirtyFields.systemEmailPassword) { - // Not in reset mode and not dirty -> exclude (no changes) - delete toSubmit.systemEmailPassword; - } - - // Handle API key field (same logic) - if (apiKeyHasBeenReset) { - // Keep API key field (even if empty) to allow unsetting - } else if (!form.formState.dirtyFields.pagespeedApiKey) { - // Not in reset mode and not dirty -> exclude (no changes) - delete toSubmit.pagespeedApiKey; - } - saveSettings(toSubmit); };