Skip to content

Commit

Permalink
Merge pull request #2408 from ORCID/lmendoza/qa-localstorage-check-sh…
Browse files Browse the repository at this point in the history
…ould-be-background-compatible-with-the-previous-release

qa-localstorage-check-should-be-background-compatible-with-the-previo…
  • Loading branch information
leomendoza123 authored Nov 29, 2024
2 parents a845196 + 12ee3f1 commit ce8956f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
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

0 comments on commit ce8956f

Please sign in to comment.