Skip to content

Commit

Permalink
fix: ensure target is only created once
Browse files Browse the repository at this point in the history
  • Loading branch information
kyubisation committed Jan 2, 2020
1 parent 4801c2e commit fc8f12c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/core/translation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
catchError,
distinctUntilChanged,
filter,
first,
map,
switchMap,
tap,
Expand Down Expand Up @@ -61,6 +62,7 @@ export class TranslationService {

createTarget(language: string) {
return this._root.pipe(
first(),
map(r => this._targetHref(r, language)),
switchMap(href => this._http.post<TargetResponse>(href, {})),
tap(t => this._updateTarget(t))
Expand Down

0 comments on commit fc8f12c

Please sign in to comment.