diff --git a/src/app/cdk/interstitials/interstitials.service.ts b/src/app/cdk/interstitials/interstitials.service.ts index 29e24af39..341a69251 100644 --- a/src/app/cdk/interstitials/interstitials.service.ts +++ b/src/app/cdk/interstitials/interstitials.service.ts @@ -22,9 +22,21 @@ export class InterstitialsService { return this._userInfo.getUserSession().pipe( map((userInfo) => { const effectiveUser = userInfo.userInfo.EFFECTIVE_USER_ORCID - return ( - localStorage.getItem(effectiveUser + '_' + interstitial) === 'true' - ) + if (interstitial === 'DOMAIN_INTERSTITIAL') { + // This is a weird condition as we changed the localstorage value from OAUTH_DOMAIN_INTERSTITIAL to DOMAIN_INTERSTITIAL + // This is a fix so DOMAIN_INTERSTITIAL is backwards compatible with OAUTH_DOMAIN_INTERSTITIAL + return ( + localStorage.getItem(effectiveUser + '_DOMAIN_INTERSTITIAL') === + 'true' || + localStorage.getItem( + effectiveUser + '_OAUTH_DOMAIN_INTERSTITIAL' + ) === 'true' + ) + } else { + return ( + localStorage.getItem(effectiveUser + '_' + interstitial) === 'true' + ) + } }) ) } diff --git a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts index 7910bdc42..8b502d829 100644 --- a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts +++ b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts @@ -58,7 +58,11 @@ export class ShareEmailsDomainsComponent { return value?.emailDomains .filter((domain) => domain.visibility !== 'PUBLIC') .sort((a, b) => { - return b.createdDate.timestamp - a.createdDate.timestamp + if (b?.createdDate?.timestamp && a?.createdDate?.timestamp) { + return b.createdDate.timestamp - a.createdDate.timestamp + } else { + return 0 + } }) .slice(0, 3) }