diff --git a/smp-angular/src/app/window/toolbar/toolbar.component.ts b/smp-angular/src/app/window/toolbar/toolbar.component.ts index 05a424630960ceae140eb6a15b090c18ae7e3a92..f68fcdd3140ecaf2039ca94dbea300b94329e72c 100644 --- a/smp-angular/src/app/window/toolbar/toolbar.component.ts +++ b/smp-angular/src/app/window/toolbar/toolbar.component.ts @@ -29,7 +29,8 @@ export class ToolbarComponent implements OnDestroy{ fullMenu: boolean = true; userController: UserController; currentUserRoleDescription = ""; - private sub: Subscription; + private loginSubscription: Subscription; + private languageChangeSubscription: Subscription; constructor(private alertService: AlertMessageService, private securityService: SecurityService, @@ -41,11 +42,13 @@ export class ToolbarComponent implements OnDestroy{ private translateService: TranslateService) { this.userController = new UserController(this.http, this.lookups, this.dialog); - this.sub = this.securityEventService.onLoginSuccessEvent().subscribe(async user => await this.updateCurrentUserRoleDescription()); + this.loginSubscription = this.securityEventService.onLoginSuccessEvent().subscribe(async user => await this.updateCurrentUserRoleDescription()); + this.languageChangeSubscription = this.translateService.onLangChange.subscribe(async langChangeEvent => await this.updateCurrentUserRoleDescription()); } ngOnDestroy() { - this.sub.unsubscribe(); + this.loginSubscription.unsubscribe(); + this.languageChangeSubscription.unsubscribe(); } clearWarning() {