From a5e1366b06062c077119c6916f32377856049f4b Mon Sep 17 00:00:00 2001 From: gbuomprisco Date: Thu, 3 Oct 2024 15:54:08 +0200 Subject: [PATCH] Normalize search targets to lowercase in accounts tables --- .../components/invitations/account-invitations-table.tsx | 5 ++++- .../src/components/members/account-members-table.tsx | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/features/team-accounts/src/components/invitations/account-invitations-table.tsx b/packages/features/team-accounts/src/components/invitations/account-invitations-table.tsx index 8f55ffecb..a3c9c9acc 100644 --- a/packages/features/team-accounts/src/components/invitations/account-invitations-table.tsx +++ b/packages/features/team-accounts/src/components/invitations/account-invitations-table.tsx @@ -49,7 +49,10 @@ export function AccountInvitationsTable({ const filteredInvitations = invitations.filter((member) => { const searchString = search.toLowerCase(); - const email = member.email.split('@')[0]?.toLowerCase() ?? ''; + + const email = ( + member.email.split('@')[0]?.toLowerCase() ?? '' + ).toLowerCase(); return ( email.includes(searchString) || diff --git a/packages/features/team-accounts/src/components/members/account-members-table.tsx b/packages/features/team-accounts/src/components/members/account-members-table.tsx index 7fa1a2cc8..a01155ea7 100644 --- a/packages/features/team-accounts/src/components/members/account-members-table.tsx +++ b/packages/features/team-accounts/src/components/members/account-members-table.tsx @@ -78,7 +78,12 @@ export function AccountMembersTable({ const filteredMembers = members .filter((member) => { const searchString = search.toLowerCase(); - const displayName = member.name ?? member.email.split('@')[0]; + + const displayName = ( + member.name ?? + member.email.split('@')[0] ?? + '' + ).toLowerCase(); return ( displayName.includes(searchString) ||