Skip to content

Commit

Permalink
🐛 Fix but when editing own user (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejsdev authored Mar 8, 2024
1 parent c5da975 commit 4900b2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion new-frontend/src/components/UserSettings/UserInformation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const UserInformation: React.FC = () => {
register,
handleSubmit,
reset,
getValues,
formState: { isSubmitting, errors, isDirty },
} = useForm<UserOut>({
mode: 'onBlur',
Expand Down Expand Up @@ -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'}
</Button>
Expand Down

0 comments on commit 4900b2e

Please sign in to comment.