mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 14:33:03 +00:00
93219: Fold DSpaceTransferState into InitService
This commit is contained in:
@@ -8,9 +8,8 @@
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { CheckAuthenticationTokenAction } from './core/auth/auth.actions';
|
||||
import { CorrelationIdService } from './correlation-id/correlation-id.service';
|
||||
import { DSpaceTransferState } from '../modules/transfer-state/dspace-transfer-state.service';
|
||||
import { APP_INITIALIZER, Inject, Optional, Provider, Type } from '@angular/core';
|
||||
import { TransferState } from '@angular/platform-browser';
|
||||
import { makeStateKey, TransferState } from '@angular/platform-browser';
|
||||
import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
|
||||
import { environment } from '../environments/environment';
|
||||
import { AppState } from './app.reducer';
|
||||
@@ -38,10 +37,15 @@ import { ThemeService } from './shared/theme-support/theme.service';
|
||||
* For example, NgbModal depends on ApplicationRef and can therefore not be used during initialization.
|
||||
*/
|
||||
export abstract class InitService {
|
||||
/**
|
||||
* The state transfer key to use for the NgRx store state
|
||||
* @protected
|
||||
*/
|
||||
protected static NGRX_STATE = makeStateKey('NGRX_STATE');
|
||||
|
||||
protected constructor(
|
||||
protected store: Store<AppState>,
|
||||
protected correlationIdService: CorrelationIdService,
|
||||
protected dspaceTransferState: DSpaceTransferState,
|
||||
@Inject(APP_CONFIG) protected appConfig: AppConfig,
|
||||
protected translate: TranslateService,
|
||||
protected localeService: LocaleService,
|
||||
@@ -130,14 +134,6 @@ export abstract class InitService {
|
||||
this.correlationIdService.initCorrelationId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Transfer the application's NgRx state between server-side and client-side
|
||||
* @protected
|
||||
*/
|
||||
protected async transferAppState(): Promise<unknown> {
|
||||
return this.dspaceTransferState.transfer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure the {@link environment} matches {@link APP_CONFIG} and print
|
||||
* some information about it to the console
|
||||
|
Reference in New Issue
Block a user