Skip to content

Commit bdfe5eb

Browse files
committed
Changing the way we subscribe to translations.
1 parent f9a52f1 commit bdfe5eb

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

eform-client/src/app/plugins/modules/greate-belt-pn/layouts/greate-belt-pn-layout.component.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {filter} from 'rxjs/operators';
1717
export class GreateBeltPnLayoutComponent
1818
implements AfterContentInit, OnInit, OnDestroy {
1919
currentUserLocaleAsyncSub$: Subscription;
20-
getTranslationsSub$: Subscription;
2120
private selectCurrentUserLocale$ = this.store.select(selectCurrentUserLocale);
2221
constructor(
2322
private store: Store,
@@ -32,18 +31,12 @@ export class GreateBeltPnLayoutComponent
3231

3332
ngAfterContentInit() {
3433
this.currentUserLocaleAsyncSub$ = this.selectCurrentUserLocale$.subscribe((locale) => {
35-
this.getTranslationsSub$ = this.translateService.getTranslation(locale).pipe(
36-
filter(x => !!x),
37-
tap(() => {
38-
const i18n = translates[locale];
39-
this.translateService.setTranslation(locale, i18n, true);
40-
})
41-
).subscribe()
34+
const i18n = translates[locale];
35+
this.translateService.setTranslation(locale, i18n, true);
4236
});
4337
}
4438

4539
ngOnDestroy(): void {
46-
this.getTranslationsSub$.unsubscribe();
4740
this.currentUserLocaleAsyncSub$.unsubscribe();
4841
}
4942
}

0 commit comments

Comments
 (0)