diff --git a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts index 2927b47e5d..e4475cd462 100644 --- a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts @@ -1,4 +1,4 @@ -import { Inject, Injectable } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { map, switchMap, take, tap } from 'rxjs/operators'; import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service'; @@ -15,6 +15,9 @@ import { InternalStore } from '../utils/internal-store-utils'; }) export class ConfigStateService { private readonly store = new InternalStore({} as ApplicationConfigurationDto); + private readonly includeLocalizationResources = inject(INCUDE_LOCALIZATION_RESOURCES_TOKEN); + private abpConfigService = inject(AbpApplicationConfigurationService); + private abpApplicationLocalizationService = inject(AbpApplicationLocalizationService); get createOnUpdateStream() { return this.store.sliceUpdate; @@ -22,12 +25,7 @@ export class ConfigStateService { private updateSubject = new Subject(); - constructor( - private abpConfigService: AbpApplicationConfigurationService, - private abpApplicationLocalizationService: AbpApplicationLocalizationService, - @Inject(INCUDE_LOCALIZATION_RESOURCES_TOKEN) - private readonly includeLocalizationResources: boolean, - ) { + constructor() { this.initUpdateStream(); } @@ -61,6 +59,7 @@ export class ConfigStateService { onlyDynamics: false, }); } + refreshAppState() { this.updateSubject.next(); return this.createOnUpdateStream(state => state).pipe(take(1)); @@ -141,7 +140,7 @@ export class ConfigStateService { return keys.reduce((acc, key) => ({ ...acc, [key]: features.values[key] }), {}); } - getFeatures$(keys: string[]): Observable<{[key: string]: string} | undefined> { + getFeatures$(keys: string[]): Observable<{ [key: string]: string } | undefined> { return this.store.sliceState(({ features }) => { if (!features?.values) return; diff --git a/npm/ng-packs/packages/core/testing/src/lib/core-testing.module.ts b/npm/ng-packs/packages/core/testing/src/lib/core-testing.module.ts index 1f07423779..8aab44d44b 100644 --- a/npm/ng-packs/packages/core/testing/src/lib/core-testing.module.ts +++ b/npm/ng-packs/packages/core/testing/src/lib/core-testing.module.ts @@ -7,6 +7,7 @@ import { LOADER_DELAY, PermissionService, RestService, + INCUDE_LOCALIZATION_RESOURCES_TOKEN, } from '@abp/ng.core'; import { APP_BASE_HREF } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; @@ -60,6 +61,10 @@ export class CoreTestingModule { provide: LOADER_DELAY, useValue: 0, }, + { + provide: INCUDE_LOCALIZATION_RESOURCES_TOKEN, + useValue: false, + }, provideRoutes(routes), ], };