Skip to content

Commit

Permalink
qa-localstorage-check-should-be-background-compatible-with-the-previo…
Browse files Browse the repository at this point in the history
…us-release
  • Loading branch information
leomendoza123 committed Nov 29, 2024
1 parent a845196 commit 12ee3f1
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 12ee3f1

Please sign in to comment.