mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
move the correlation id to the ngrx store
This commit is contained in:

committed by
Yura Bondarenko

parent
ba268d4f28
commit
2fe5587e02
@@ -32,6 +32,7 @@ import { ServerHardRedirectService } from '../../app/core/services/server-hard-r
|
||||
import { Angulartics2Mock } from '../../app/shared/mocks/angulartics2.service.mock';
|
||||
import { AuthRequestService } from '../../app/core/auth/auth-request.service';
|
||||
import { ServerAuthRequestService } from '../../app/core/auth/server-auth-request.service';
|
||||
import { CorrelationIdService } from '../../app/correlation-id/correlation-id.service';
|
||||
import { AppConfig, APP_CONFIG_STATE } from '../../config/app-config.interface';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
@@ -65,11 +66,17 @@ export function createTranslateLoader() {
|
||||
// Initialize app config and extend environment
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: (transferState: TransferState) => {
|
||||
useFactory: (
|
||||
transferState: TransferState,
|
||||
dspaceTransferState: DSpaceTransferState,
|
||||
correlationIdService: CorrelationIdService,
|
||||
) => {
|
||||
transferState.set<AppConfig>(APP_CONFIG_STATE, environment as AppConfig);
|
||||
dspaceTransferState.transfer();
|
||||
correlationIdService.initCorrelationId();
|
||||
return () => true;
|
||||
},
|
||||
deps: [TransferState],
|
||||
deps: [TransferState, DSpaceTransferState, CorrelationIdService],
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
@@ -117,9 +124,4 @@ export function createTranslateLoader() {
|
||||
]
|
||||
})
|
||||
export class ServerAppModule {
|
||||
constructor(
|
||||
private transferState: DSpaceTransferState,
|
||||
) {
|
||||
this.transferState.transfer();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user