CP Fixing undefined language bug

This commit is contained in:
ThomasFransolet 2019-08-18 18:41:31 +02:00
parent edf63e1dae
commit d114ba16c3

View File

@ -82,11 +82,15 @@ export class AppComponent implements OnInit {
this.Password = null;
this._authService.IsLoggedIn = true;
console.log(this.ConnectedUser.language);
if (this.ConnectedUser.language === null) {
this._translateService.setDefaultLang('en');
} else {
if (this.ConnectedUser.language === 'gb') {
this._translateService.setDefaultLang('en');
} else {
this._translateService.setDefaultLang(this.ConnectedUser.language);
}
}
} else {
this._translateService.setDefaultLang('en');
}
@ -173,6 +177,7 @@ export class AppComponent implements OnInit {
public CreateProfile() {
if (this.CorrectForm()) {
this.CreateUser.deviceIds = [];
this.CreateUser.language = 'gb';
this._userService.CreateUser(this.CreateUser)
.subscribe(