From 4900b2e67692e6cbd672ea0b36cdb7164b2ef15b Mon Sep 17 00:00:00 2001 From: Alejandra <90076947+alejsdev@users.noreply.github.com> Date: Fri, 8 Mar 2024 17:43:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20but=20when=20editing=20own?= =?UTF-8?q?=20user=20(#651)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- new-frontend/src/components/UserSettings/UserInformation.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/new-frontend/src/components/UserSettings/UserInformation.tsx b/new-frontend/src/components/UserSettings/UserInformation.tsx index bbfba017ab..7d75f71676 100644 --- a/new-frontend/src/components/UserSettings/UserInformation.tsx +++ b/new-frontend/src/components/UserSettings/UserInformation.tsx @@ -29,6 +29,7 @@ const UserInformation: React.FC = () => { register, handleSubmit, reset, + getValues, formState: { isSubmitting, errors, isDirty }, } = useForm({ mode: 'onBlur', @@ -128,7 +129,7 @@ const UserInformation: React.FC = () => { onClick={toggleEditMode} type={editMode ? 'button' : 'submit'} isLoading={editMode ? isSubmitting : false} - isDisabled={editMode ? !isDirty : false} + isDisabled={editMode ? !isDirty || !getValues('email') : false} > {editMode ? 'Save' : 'Edit'}