From e9bab07309fcdcaa8d256aebc1fd791b77ecbb0d Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Thu, 11 Jul 2024 18:55:26 -0400 Subject: [PATCH] Added small fix to prevent spamming the save button --- Client/src/Components/TabPanels/Account/ProfilePanel.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Client/src/Components/TabPanels/Account/ProfilePanel.jsx b/Client/src/Components/TabPanels/Account/ProfilePanel.jsx index 2fdbba2e6..27949be8a 100644 --- a/Client/src/Components/TabPanels/Account/ProfilePanel.jsx +++ b/Client/src/Components/TabPanels/Account/ProfilePanel.jsx @@ -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; }