From 748bb9a20d221911786b7555c8e0824282d3301d Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:17:43 +0200 Subject: [PATCH] fix professional email detection logic --- src/app/core/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/core/utils.ts b/src/app/core/utils.ts index f0ccc6f6c..67c233f51 100644 --- a/src/app/core/utils.ts +++ b/src/app/core/utils.ts @@ -5,7 +5,10 @@ export const setProfessionalEmails = ( ): EmailsEndpoint => { emails?.emailDomains?.forEach((domain) => { emails?.emails?.forEach((email) => { - if (email?.value?.includes(domain?.value)) { + if ( + email?.value?.split('@')[1].endsWith('.' + domain?.value) || + email?.value?.split('@')[1] === domain?.value + ) { email.professionalEmail = true } })