This commit is contained in:
leejinho 2020-02-05 11:48:19 +09:00
parent e2f271eba4
commit e87320d1ee

View File

@ -146,6 +146,7 @@ export class OrganizationComponent
loginInfo: LoginInfo;
loginRes: LoginResponse;
loginResSubscription: Subscription;
sessionVerinfo: VersionInfo2Response;
environmentsInfo: EnvironmentsInfo;
authInfo: AuthResponse;
@ -186,6 +187,16 @@ export class OrganizationComponent
select(AppStore.MessengerSelector.QuerySelector.departmentInfoList)
);
this.loginResSubscription = this.store
.pipe(
take(1),
select(AppStore.AccountSelector.AuthenticationSelector.loginRes),
tap(loginRes => {
this.loginRes = loginRes;
})
)
.subscribe();
this.myDepartmentUserInfoListSubscription = this.store
.pipe(
select(
@ -230,6 +241,14 @@ export class OrganizationComponent
this.selectedDepartmentUserInfoList = list;
}
if (!!this.loginRes) {
this.selectedDepartmentName = {
name: this.loginRes.userInfo.deptName,
nameEn: this.loginRes.userInfo.deptNameEn,
nameCn: this.loginRes.userInfo.deptNameCn
};
}
if (!!this.vsDeptUser) {
this.vsDeptUser.scrollToIndex(0, true, 0, 0);
}
@ -252,6 +271,9 @@ export class OrganizationComponent
}
ngOnDestroy(): void {
if (!!this.loginResSubscription) {
this.loginResSubscription.unsubscribe();
}
if (!!this.myDepartmentUserInfoListSubscription) {
this.myDepartmentUserInfoListSubscription.unsubscribe();
}