Browse Source

Merge pull request #16033 from abpframework/bug/16017-SE

Add Optional and use !! to include localization resou…
pull/16043/head
Masum ULU 3 years ago
committed by GitHub
parent
commit
7b2597ed1d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      npm/ng-packs/packages/core/src/lib/services/config-state.service.ts

15
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, Optional } 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,9 +15,6 @@ 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;
@ -25,7 +22,13 @@ export class ConfigStateService {
private updateSubject = new Subject<void>();
constructor() {
constructor(
private abpConfigService: AbpApplicationConfigurationService,
private abpApplicationLocalizationService: AbpApplicationLocalizationService,
@Optional()
@Inject(INCUDE_LOCALIZATION_RESOURCES_TOKEN)
private readonly includeLocalizationResources: boolean | null,
) {
this.initUpdateStream();
}
@ -34,7 +37,7 @@ export class ConfigStateService {
.pipe(
switchMap(() =>
this.abpConfigService.get({
includeLocalizationResources: this.includeLocalizationResources,
includeLocalizationResources: !!this.includeLocalizationResources,
}),
),
)

Loading…
Cancel
Save