Skip to content

Commit 954ffa3

Browse files
load interstitials after loading user session in oauth (#2488)
* load interstitials after loading user session in oauth * load-interstitials-after-loading-user-session-in-oauth * load-interstitials-after-loading-user-session-in-oauth * move user session filter to interstitial service --------- Co-authored-by: Leonardo Mendoza <[email protected]>
1 parent eb7f375 commit 954ffa3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/app/authorize/pages/authorize/authorize.component.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,17 @@ export class AuthorizeComponent {
6363
forkJoin({
6464
userSession: this.loadUserSession(),
6565
platform: this.loadPlatformInfo(),
66-
interstitial: this.loadInterstitialViewed(),
6766
togglz: this.loadTogglzState(),
6867
emails: this.loadEmails(),
69-
}).subscribe(({ userSession }) => {
70-
this.handleUserSession(userSession)
7168
})
69+
.pipe(
70+
tap(() => {
71+
this.loadInterstitialViewed()
72+
})
73+
)
74+
.subscribe(({ userSession }) => {
75+
this.handleUserSession(userSession)
76+
})
7277
}
7378

7479
/**

src/app/cdk/interstitials/interstitials.service.ts

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class InterstitialsService {
2929

3030
getInterstitialsViewed(interstitial: Interstitials): Observable<boolean> {
3131
return this._userInfo.getUserSession().pipe(
32+
filter((userInfo) => !!userInfo.userInfo),
3233
map((userInfo) => {
3334
const effectiveUser = userInfo?.userInfo?.EFFECTIVE_USER_ORCID
3435
if (interstitial === 'DOMAIN_INTERSTITIAL') {

0 commit comments

Comments
 (0)