From e2b9a6fa161a84cd75487ed81c07fc35f91a07ce Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Fri, 12 Jul 2024 11:33:34 -0400 Subject: [PATCH] Clear unchanged error when picture is modified --- Client/src/Components/TabPanels/Account/ProfilePanel.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Client/src/Components/TabPanels/Account/ProfilePanel.jsx b/Client/src/Components/TabPanels/Account/ProfilePanel.jsx index 52d10a2f5..e96f507d9 100644 --- a/Client/src/Components/TabPanels/Account/ProfilePanel.jsx +++ b/Client/src/Components/TabPanels/Account/ProfilePanel.jsx @@ -23,6 +23,7 @@ import ProgressUpload from "../../ProgressBars"; import { formatBytes } from "../../../Utils/fileUtils"; import { clearMonitorState } from "../../../Features/Monitors/monitorsSlice"; import { createToast } from "../../../Utils/toastUtils"; + /** * ProfilePanel component displays a form for editing user profile information * and allows for actions like updating profile picture, credentials, @@ -152,6 +153,7 @@ const ProfilePanel = () => { deleteProfileImage: false, })); setIsOpen(""); + errors["unchanged"] && clearError("unchanged"); }; // Handles form submission to update user profile @@ -194,6 +196,7 @@ const ProfilePanel = () => { ...prev, deleteProfileImage: true, })); + errors["unchanged"] && clearError("unchanged"); }; // Initiates the account deletion process