Skip to content

Commit

Permalink
9499-email-domains-interstitial-registry-sign-in
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 committed Nov 27, 2024
1 parent e6382ab commit 3c79045
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/app/core/login-interstitials/login-interstitials.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class LoginInterstitialsService {
this.interstitialService
.getInterstitialsViewed('DOMAIN_INTERSTITIAL')
.subscribe((viewed) => {
// this.alreadySawSignDomainInterstitial = viewed
this.alreadySawSignDomainInterstitial = viewed
})
this.toggleService
.getStateOf('LOGIN_DOMAINS_INTERSTITIAL')
Expand All @@ -39,38 +39,38 @@ export class LoginInterstitialsService {
checkLoginInterstitials(userRecord: UserRecord): Observable<string[]> | void {
if (
userRecord?.userInfo &&
userRecord?.emails &&
userRecord?.emails?.emailDomains &&
!this.alreadyCheckLoginInterstitials
) {
this.alreadyCheckLoginInterstitials = true
// const isNotImpersonating =
// userRecord.userInfo.REAL_USER_ORCID ===
// userRecord.userInfo.EFFECTIVE_USER_ORCID
const isNotImpersonating =
userRecord.userInfo.REAL_USER_ORCID ===
userRecord.userInfo.EFFECTIVE_USER_ORCID

// if (
// isNotImpersonating &&
// !this.userHasPublicDomains(userRecord.emails) &&
// this.userHasPrivateDomains(userRecord.emails) &&
// this.loginDomainsInterstitialEnabled &&
// !this.alreadySawSignDomainInterstitial
// ) {
this.alreadySawSignDomainInterstitial = true
this.interstitialService
.setInterstitialsViewed('DOMAIN_INTERSTITIAL')
.subscribe()
const data: ShareEmailsDomainsComponentDialogInput = {
userEmailsJson: userRecord.emails,
}
if (
isNotImpersonating &&
!this.userHasPublicDomains(userRecord.emails) &&
this.userHasPrivateDomains(userRecord.emails) &&
this.loginDomainsInterstitialEnabled &&
!this.alreadySawSignDomainInterstitial
) {
this.alreadySawSignDomainInterstitial = true
this.interstitialService
.setInterstitialsViewed('DOMAIN_INTERSTITIAL')
.subscribe()
const data: ShareEmailsDomainsComponentDialogInput = {
userEmailsJson: userRecord.emails,
}

const dialog = this._matDialog.open(ShareEmailsDomainsDialogComponent, {
data,
width: '580px',
disableClose: true,
autoFocus: false,
restoreFocus: false,
})
return dialog.afterClosed()
// }
const dialog = this._matDialog.open(ShareEmailsDomainsDialogComponent, {
data,
width: '580px',
disableClose: true,
autoFocus: false,
restoreFocus: false,
})
return dialog.afterClosed()
}
}
}

Expand All @@ -81,4 +81,4 @@ export class LoginInterstitialsService {
userHasPrivateDomains(value: EmailsEndpoint): boolean {
return !!value.emailDomains.find((domain) => domain.visibility !== 'PUBLIC')
}
}
}

0 comments on commit 3c79045

Please sign in to comment.