diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html index f1e572f8..4df1763d 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html @@ -12,11 +12,13 @@
- + + +
diff --git a/projects/ucap-webmessenger-ui-account/src/lib/components/login.component.ts b/projects/ucap-webmessenger-ui-account/src/lib/components/login.component.ts index 8d5a67d5..d5adc0bd 100644 --- a/projects/ucap-webmessenger-ui-account/src/lib/components/login.component.ts +++ b/projects/ucap-webmessenger-ui-account/src/lib/components/login.component.ts @@ -5,7 +5,8 @@ import { Output, EventEmitter, ViewChild, - ElementRef + ElementRef, + ChangeDetectorRef } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { Company } from '@ucap-webmessenger/api-external'; @@ -40,6 +41,7 @@ export class LoginComponent implements OnInit { constructor( private formBuilder: FormBuilder, + private changeDetectorRef: ChangeDetectorRef, private localStorageService: LocalStorageService ) {} @@ -47,21 +49,20 @@ export class LoginComponent implements OnInit { const loginInfo: LoginInfo = this.localStorageService.get( KEY_LOGIN_INFO ); - let companyCode = ''; - let loginId = ''; - let remember = false; - if (loginInfo && loginInfo.companyCode && loginInfo.loginId) { - companyCode = loginInfo.companyCode; - loginId = loginInfo.loginId; - remember = true; - } this.loginForm = this.formBuilder.group({ - companyCode: [companyCode, [Validators.required]], - loginId: [loginId, [Validators.required]], + companyCode: ['', [Validators.required]], + loginId: ['', [Validators.required]], loginPw: ['', Validators.required], - remember: [remember] + remember: [false] }); + if (loginInfo && loginInfo.companyCode && loginInfo.loginId) { + this.loginForm.get('companyCode').setValue(loginInfo.companyCode); + this.loginForm.get('loginId').setValue(loginInfo.loginId); + this.loginForm.get('remember').setValue(true); + this.changeDetectorRef.detectChanges(); + } + if (!this.loginBtnText || this.loginBtnText.trim().length === 0) { this.loginBtnText = 'LOGIN'; }