Skip to content

Commit

Permalink
only display domain or email on public page (#2334)
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn authored Aug 28, 2024
1 parent acda5b9 commit 6a17104
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/cdk/side-bar/side-bar/side-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
}
})
Expand Down

0 comments on commit 6a17104

Please sign in to comment.