File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,12 +3,9 @@ import {
33 provideHttpClient ,
44 withInterceptorsFromDi ,
55} from '@angular/common/http' ;
6- import {
7- APP_INITIALIZER ,
8- NgModule ,
9- } from '@angular/core' ;
106import {
117 APP_ID ,
8+ APP_INITIALIZER ,
129 ApplicationConfig ,
1310 importProvidersFrom ,
1411 makeStateKey ,
@@ -53,10 +50,10 @@ import { ClientCookieService } from '../../app/core/services/client-cookie.servi
5350import { CookieService } from '../../app/core/services/cookie.service' ;
5451import { HardRedirectService } from '../../app/core/services/hard-redirect.service' ;
5552import { ReferrerService } from '../../app/core/services/referrer.service' ;
56- import { BrowserXSRFService } from '../../app/core/xsrf/browser-xsrf.service' ;
57- import { XSRFService } from '../../app/core/xsrf/xsrf.service' ;
5853import { ClientMathService } from '../../app/core/shared/client-math.service' ;
5954import { MathService } from '../../app/core/shared/math.service' ;
55+ import { BrowserXSRFService } from '../../app/core/xsrf/browser-xsrf.service' ;
56+ import { XSRFService } from '../../app/core/xsrf/xsrf.service' ;
6057import { BrowserKlaroService } from '../../app/shared/cookies/browser-klaro.service' ;
6158import { KlaroService } from '../../app/shared/cookies/klaro.service' ;
6259import { MissingTranslationHelper } from '../../app/shared/translate/missing-translation.helper' ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { Store } from '@ngrx/store';
1818import { TranslateService } from '@ngx-translate/core' ;
1919import {
2020 firstValueFrom ,
21+ lastValueFrom ,
2122 Subscription ,
2223} from 'rxjs' ;
2324import {
@@ -124,7 +125,7 @@ export class BrowserInitService extends InitService {
124125
125126 this . initKlaro ( ) ;
126127
127- await this . authenticationReady$ ( ) . toPromise ( ) ;
128+ await lastValueFrom ( this . authenticationReady$ ( ) ) ;
128129
129130 return true ;
130131 } ;
@@ -141,10 +142,12 @@ export class BrowserInitService extends InitService {
141142 const state = this . transferState . get < any > ( InitService . NGRX_STATE , null ) ;
142143 this . transferState . remove ( InitService . NGRX_STATE ) ;
143144 this . store . dispatch ( new StoreAction ( StoreActionTypes . REHYDRATE , state ) ) ;
144- return this . store . select ( coreSelector ) . pipe (
145- find ( ( core : any ) => isNotEmpty ( core ) ) ,
146- map ( ( ) => true ) ,
147- ) . toPromise ( ) ;
145+ return lastValueFrom (
146+ this . store . select ( coreSelector ) . pipe (
147+ find ( ( core : any ) => isNotEmpty ( core ) ) ,
148+ map ( ( ) => true ) ,
149+ ) ,
150+ ) ;
148151 }
149152
150153 private trackAuthTokenExpiration ( ) : void {
@@ -190,7 +193,7 @@ export class BrowserInitService extends InitService {
190193 * @private
191194 */
192195 private closeAuthCheckSubscription ( ) {
193- firstValueFrom ( this . authenticationReady$ ( ) ) . then ( ( ) => {
196+ void firstValueFrom ( this . authenticationReady$ ( ) ) . then ( ( ) => {
194197 this . sub . unsubscribe ( ) ;
195198 } ) ;
196199 }
Original file line number Diff line number Diff line change 88import {
99 Inject ,
1010 Injectable ,
11+ TransferState ,
1112} from '@angular/core' ;
12- import { TransferState } from '@angular/platform-browser' ;
1313import { Store } from '@ngrx/store' ;
1414import { TranslateService } from '@ngx-translate/core' ;
15+ import { lastValueFrom } from 'rxjs' ;
1516import { take } from 'rxjs/operators' ;
1617
1718import { AppState } from '../../app/app.reducer' ;
@@ -75,7 +76,7 @@ export class ServerInitService extends InitService {
7576 this . initRouteListeners ( ) ;
7677 this . themeService . listenForThemeChanges ( false ) ;
7778
78- await this . authenticationReady$ ( ) . toPromise ( ) ;
79+ await lastValueFrom ( this . authenticationReady$ ( ) ) ;
7980
8081 return true ;
8182 } ;
You can’t perform that action at this time.
0 commit comments