diff --git a/apps/red-ui/src/app/i18n/language.service.ts b/apps/red-ui/src/app/i18n/language.service.ts index cd21180b4..3766af790 100644 --- a/apps/red-ui/src/app/i18n/language.service.ts +++ b/apps/red-ui/src/app/i18n/language.service.ts @@ -21,7 +21,6 @@ export class LanguageService { chooseAndSetInitialLanguage() { let defaultLang: string; const userPreferenceLang = this._userPreferenceService.getLanguage(); - // const browserLang = this._translateService.getBrowserLang(); const browserLang = 'en'; // Force language to english until translations are ready if (this.languageAvailable(userPreferenceLang)) { defaultLang = userPreferenceLang; diff --git a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.html b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.html index 25d5a5a44..e984688de 100644 --- a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.html +++ b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.html @@ -1,4 +1,4 @@ -
+
@@ -30,7 +30,7 @@
-
diff --git a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts index 8b6770493..8c3d896bf 100644 --- a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts @@ -17,7 +17,7 @@ import { LanguageService } from '../../../../../i18n/language.service'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class UserProfileScreenComponent implements OnInit { - readonly formGroup: FormGroup = this._getForm(); + readonly form: FormGroup = this._getForm(); changePasswordUrl: SafeResourceUrl; translations = languagesTranslations; @@ -50,16 +50,15 @@ export class UserProfileScreenComponent implements OnInit { } get languageChanged(): boolean { - console.log('plm'); - return this._profileModel['language'] !== this.formGroup.get('language').value; + return this._profileModel['language'] !== this.form.get('language').value; } get profileChanged(): boolean { - const keys = Object.keys(this.formGroup.getRawValue()); + const keys = Object.keys(this.form.getRawValue()); keys.splice(keys.indexOf('language'), 1); for (const key of keys) { - if (this._profileModel[key] !== this.formGroup.get(key).value) { + if (this._profileModel[key] !== this.form.get(key).value) { return true; } } @@ -79,11 +78,11 @@ export class UserProfileScreenComponent implements OnInit { this._loadingService.start(); if (this.languageChanged) { - await this._languageService.changeLanguage(this.formGroup.get('language').value); + await this._languageService.changeLanguage(this.form.get('language').value); } if (this.profileChanged) { - const value = this.formGroup.value as IProfile; + const value = this.form.value as IProfile; delete value.language; await this._userService @@ -109,9 +108,9 @@ export class UserProfileScreenComponent implements OnInit { }; if (this._userService.currentUser.email) { // disable email if it's already set - this.formGroup.get('email').disable(); + this.form.get('email').disable(); } - this.formGroup.patchValue(this._profileModel, { emitEvent: false }); + this.form.patchValue(this._profileModel, { emitEvent: false }); } catch (e) { } finally { this._loadingService.stop();