From e1d0b26cf98e8e14408bb20fa8ca562d838c43f4 Mon Sep 17 00:00:00 2001 From: Hinson Chan Date: Fri, 26 Apr 2024 06:23:03 -0700 Subject: [PATCH] 5180 - does not call debounced update for invalid names (#5181) 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 --- .../modules/settings/profile/components/NameFields.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/settings/profile/components/NameFields.tsx b/packages/twenty-front/src/modules/settings/profile/components/NameFields.tsx index a279c75e3..8ec7efa27 100644 --- a/packages/twenty-front/src/modules/settings/profile/components/NameFields.tsx +++ b/packages/twenty-front/src/modules/settings/profile/components/NameFields.tsx @@ -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(); }