diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts index 2a2b75c8..37427654 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts @@ -209,27 +209,27 @@ export class OrganizationComponent .pipe( take(1), select(AppStore.AccountSelector.AuthenticationSelector.loginRes), - map(loginRes => { - this.store.dispatch( - QueryStore.myDeptUser({ - divCd: 'ORG', - companyCode: this.loginInfo.companyCode, - seq: loginRes.departmentCode, - search: '', - searchRange: DeptSearchType.All, - senderCompanyCode: this.loginInfo.companyCode, - senderEmployeeType: loginRes.userInfo.employeeType - }) - ); - return loginRes; - }), - map(loginRes => { + tap(loginRes => { + if (!!loginRes) { + this.store.dispatch( + QueryStore.myDeptUser({ + divCd: 'ORG', + companyCode: this.loginInfo.companyCode, + seq: loginRes.departmentCode, + search: '', + searchRange: DeptSearchType.All, + senderCompanyCode: this.loginInfo.companyCode, + senderEmployeeType: loginRes.userInfo.employeeType + }) + ); + + this.selectedDepartmentName = { + name: loginRes.userInfo.deptName, + nameEn: loginRes.userInfo.deptNameEn, + nameCn: loginRes.userInfo.deptNameCn + }; + } this.loginRes = loginRes; - this.selectedDepartmentName = { - name: loginRes.userInfo.deptName, - nameEn: loginRes.userInfo.deptNameEn, - nameCn: loginRes.userInfo.deptNameCn - }; }) ) .subscribe();