Skip to content

Commit

Permalink
fix(localization): avoid NoSuchElementException when adding a new loc…
Browse files Browse the repository at this point in the history
…ale (#1652)

* use take(1) to avoid NoSuchElementException
  • Loading branch information
andreassteinmann authored May 10, 2024
1 parent 1347fd8 commit b4971a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/core/utils/translate/icm-translate-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { routerNavigationAction } from '@ngrx/router-store';
import { TranslateLoader } from '@ngx-translate/core';
import { memoize } from 'lodash-es';
import { Subject, combineLatest, defer, from, iif, of } from 'rxjs';
import { catchError, filter, first, map, shareReplay, switchMap, takeUntil, tap } from 'rxjs/operators';
import { catchError, filter, map, shareReplay, switchMap, take, takeUntil, tap } from 'rxjs/operators';

import { LocalizationsService } from 'ish-core/services/localizations/localizations.service';
import { InjectSingle } from 'ish-core/utils/injection';
Expand Down Expand Up @@ -41,7 +41,7 @@ export class ICMTranslateLoader implements TranslateLoader {
// the localization call should wait until all server supplied configuration parameter are applied to the state
this.actions$.pipe(
ofType(routerNavigationAction),
first(),
take(1),
switchMap(() =>
this.localizations.getServerTranslations(lang).pipe(
tap(data => {
Expand Down

0 comments on commit b4971a3

Please sign in to comment.