Skip to content

Commit

Permalink
5180 - does not call debounced update for invalid names (#5181)
Browse files Browse the repository at this point in the history
fix: #5180 

Previously, clearing your name would kick you to the profile creation
page.


https://github.com/twentyhq/twenty/assets/68029599/8c0087da-6b03-4b6e-b202-eabe8ebcee18


Fixed so it checks your name is valid before calling the debounced
update


https://github.com/twentyhq/twenty/assets/68029599/4bc71d8f-e4f4-49ae-9cb8-497bd971be94

---------

Co-authored-by: Weiko <[email protected]>
  • Loading branch information
flatypus and Weiko authored Apr 26, 2024
1 parent 224c8d3 commit e1d0b26
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ export const NameFields = ({
return;
}

const { firstName: currentFirstName, lastName: currentLastName } =
currentWorkspaceMember.name;

if (
currentWorkspaceMember.name?.firstName !== firstName ||
currentWorkspaceMember.name?.lastName !== lastName
(currentFirstName !== firstName || currentLastName !== lastName) &&
firstName !== '' &&
lastName !== ''
) {
debouncedUpdate();
}
Expand Down

0 comments on commit e1d0b26

Please sign in to comment.