From 6a1710473f55aafe22a6b26e83932033676c35c7 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:14:39 +0300 Subject: [PATCH] only display domain or email on public page (#2334) --- src/app/cdk/side-bar/side-bar/side-bar.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/cdk/side-bar/side-bar/side-bar.component.ts b/src/app/cdk/side-bar/side-bar/side-bar.component.ts index 0f2df0653..fb41b2106 100644 --- a/src/app/cdk/side-bar/side-bar/side-bar.component.ts +++ b/src/app/cdk/side-bar/side-bar/side-bar.component.ts @@ -154,6 +154,7 @@ export class SideBarComponent implements OnInit, OnDestroy { this.publicEmailList.length === 0 && this.publicDomainList.length === 0 ) { + const domainsToExclude: AssertionVisibilityString[] = [] this.userRecord.emails?.emails?.forEach((email) => { const professionalDomain = this.userRecord.emails.emailDomains?.find( (emailDomain) => email.value.split('@')[1] === emailDomain.value @@ -162,6 +163,7 @@ export class SideBarComponent implements OnInit, OnDestroy { if (professionalDomain) { if (email.visibility === 'PUBLIC') { this.publicEmailList.push(email) + domainsToExclude.push(professionalDomain) } else if ( professionalDomain.visibility === 'PUBLIC' && !this.publicDomainList.includes(professionalDomain) @@ -173,7 +175,10 @@ export class SideBarComponent implements OnInit, OnDestroy { } }) this.userRecord.emails?.emailDomains?.forEach((emailDomain) => { - if (emailDomain.visibility === 'PUBLIC') { + if ( + emailDomain.visibility === 'PUBLIC' && + !domainsToExclude.includes(emailDomain) + ) { this.publicDomainList.push(emailDomain) } })