Added small fix to prevent spamming the save button

This commit is contained in:
Daniel Cojocea
2024-07-11 18:55:26 -04:00
parent 7e1ccff00d
commit e9bab07309
@@ -58,6 +58,7 @@ const ProfilePanel = () => {
// Handles input field changes and performs validation
const handleChange = (event) => {
errors["unchanged"] && clearError("unchanged");
const { value, id } = event.target;
const name = idToName[id];
setLocalData((prev) => ({
@@ -163,10 +164,11 @@ const ProfilePanel = () => {
localData.file === undefined
) {
createToast({
variant: "error",
variant: "warning",
body: "Unable to update profile: No changes detected.",
hasIcon: false,
});
setErrors({ unchanged: "unable to update profile" });
return;
}