diff --git a/src/components/Common/AvatarEditModal.tsx b/src/components/Common/AvatarEditModal.tsx index e17a8bffa8..06b5d5013c 100644 --- a/src/components/Common/AvatarEditModal.tsx +++ b/src/components/Common/AvatarEditModal.tsx @@ -114,8 +114,10 @@ const AvatarEditModal = ({ setIsProcessing(true); setIsCaptureImgBeingUploaded(true); - await handleUpload(selectedFile, () => { + setSelectedFile(undefined); + setPreview(undefined); + setPreviewImage(null); setIsCaptureImgBeingUploaded(false); setIsProcessing(false); }); diff --git a/src/components/Facility/FacilityHome.tsx b/src/components/Facility/FacilityHome.tsx index 1350588917..030763b24c 100644 --- a/src/components/Facility/FacilityHome.tsx +++ b/src/components/Facility/FacilityHome.tsx @@ -133,6 +133,8 @@ export const FacilityHome = ({ facilityId }: Props) => { facilityFetch(); Notification.Success({ msg: "Cover image updated." }); setEditCoverImage(false); + } else { + onError(); } }, null, diff --git a/src/components/Users/UserProfile.tsx b/src/components/Users/UserProfile.tsx index 7aa3c9eff3..b84ad7e2be 100644 --- a/src/components/Users/UserProfile.tsx +++ b/src/components/Users/UserProfile.tsx @@ -494,6 +494,8 @@ export default function UserProfile() { refetchUser(); Notification.Success({ msg: "Profile picture updated." }); setEditAvatar(false); + } else { + onError(); } }, null,