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) } })