From 778fca9db61acf2da8286f36298be43ae668f89c Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:33:45 +0530 Subject: [PATCH] fix: profile picture modal close on remove functionality added and mutation fix (#4757) --- web/app/profile/page.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/app/profile/page.tsx b/web/app/profile/page.tsx index ebc0dfaf7..66a2a7b54 100644 --- a/web/app/profile/page.tsx +++ b/web/app/profile/page.tsx @@ -54,6 +54,7 @@ const ProfileSettingsPage = observer(() => { reset, watch, control, + setValue, formState: { errors }, } = useForm({ defaultValues }); // store hooks @@ -104,6 +105,7 @@ const ProfileSettingsPage = observer(() => { message: "Profile picture deleted successfully.", }); setIsRemoving(false); + setValue("avatar", ""); }) .catch(() => { setToast({ @@ -112,7 +114,10 @@ const ProfileSettingsPage = observer(() => { message: "There was some error in deleting your profile picture. Please try again.", }); }) - .finally(() => setIsRemoving(false)); + .finally(() => { + setIsRemoving(false); + setIsImageUploadModalOpen(false); + }); }); };