@@ -35,6 +35,7 @@ import { RootDataService } from '../../app/core/data/root-data.service';
3535import { firstValueFrom , lastValueFrom , Subscription } from 'rxjs' ;
3636import { ServerCheckGuard } from '../../app/core/server-check/server-check.guard' ;
3737import { HALEndpointService } from '../../app/core/shared/hal-endpoint.service' ;
38+ import { BuildConfig } from '../../config/build-config.interface' ;
3839
3940/**
4041 * Performs client-side initialization.
@@ -48,7 +49,7 @@ export class BrowserInitService extends InitService {
4849 protected store : Store < AppState > ,
4950 protected correlationIdService : CorrelationIdService ,
5051 protected transferState : TransferState ,
51- @Inject ( APP_CONFIG ) protected appConfig : AppConfig ,
52+ @Inject ( APP_CONFIG ) protected appConfig : BuildConfig ,
5253 protected translate : TranslateService ,
5354 protected localeService : LocaleService ,
5455 protected angulartics2DSpace : Angulartics2DSpace ,
@@ -90,9 +91,7 @@ export class BrowserInitService extends InitService {
9091
9192 protected init ( ) : ( ) => Promise < boolean > {
9293 return async ( ) => {
93- if ( this . appConfig . ui . transferState ) {
94- await this . loadAppState ( ) ;
95- }
94+ await this . loadAppState ( ) ;
9695 this . checkAuthenticationToken ( ) ;
9796 this . externalAuthCheck ( ) ;
9897 this . initCorrelationId ( ) ;
@@ -124,7 +123,7 @@ export class BrowserInitService extends InitService {
124123 */
125124 private async loadAppState ( ) : Promise < boolean > {
126125 // The app state can be transferred only when SSR and CSR are using the same base url for the REST API
127- if ( this . appConfig . ui . transferState && ( ! this . appConfig . rest . hasSsrBaseUrl || this . appConfig . ui . replaceRestUrl ) ) {
126+ if ( this . appConfig . universal . transferState ) {
128127 const state = this . transferState . get < any > ( InitService . NGRX_STATE , null ) ;
129128 this . transferState . remove ( InitService . NGRX_STATE ) ;
130129 this . store . dispatch ( new StoreAction ( StoreActionTypes . REHYDRATE , state ) ) ;
0 commit comments