1- import { Injectable } from '@angular/core' ;
1+ import { Inject , Injectable } from '@angular/core' ;
22import { Observable , of , switchMap , combineLatest } from 'rxjs' ;
33import { map , take } from 'rxjs/operators' ;
44import { CookieService } from '../core/services/cookie.service' ;
@@ -11,6 +11,7 @@ import cloneDeep from 'lodash/cloneDeep';
1111import { environment } from '../../environments/environment' ;
1212import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils' ;
1313import { KlaroService } from '../shared/cookies/klaro.service' ;
14+ import { AppConfig , APP_CONFIG } from '../../config/app-config.interface' ;
1415
1516/**
1617 * Name of the cookie used to store the settings locally
@@ -64,6 +65,7 @@ export class AccessibilitySettingsService {
6465 protected authService : AuthService ,
6566 protected ePersonService : EPersonDataService ,
6667 protected klaroService : KlaroService ,
68+ @Inject ( APP_CONFIG ) protected appConfig : AppConfig ,
6769 ) {
6870 }
6971
@@ -221,7 +223,7 @@ export class AccessibilitySettingsService {
221223 map ( ( accessibilityCookieAccepted : boolean ) => {
222224 if ( accessibilityCookieAccepted ) {
223225 if ( isNotEmpty ( settings ) ) {
224- this . cookieService . set ( ACCESSIBILITY_COOKIE , settings , { expires : environment . accessibility . cookieExpirationDuration } ) ;
226+ this . cookieService . set ( ACCESSIBILITY_COOKIE , settings , { expires : this . appConfig . accessibility . cookieExpirationDuration } ) ;
225227 } else {
226228 this . cookieService . remove ( ACCESSIBILITY_COOKIE ) ;
227229 }
0 commit comments