Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa-localstorage-check-should-be-background-compatible-with-the-previo… #2408

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/app/cdk/interstitials/interstitials.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
}
})
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down