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; loginInfo: LoginInfo;
loginRes: LoginResponse; loginRes: LoginResponse;
loginResSubscription: Subscription;
sessionVerinfo: VersionInfo2Response; sessionVerinfo: VersionInfo2Response;
environmentsInfo: EnvironmentsInfo; environmentsInfo: EnvironmentsInfo;
authInfo: AuthResponse; authInfo: AuthResponse;
@ -186,6 +187,16 @@ export class OrganizationComponent
select(AppStore.MessengerSelector.QuerySelector.departmentInfoList) 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 this.myDepartmentUserInfoListSubscription = this.store
.pipe( .pipe(
select( select(
@ -230,6 +241,14 @@ export class OrganizationComponent
this.selectedDepartmentUserInfoList = list; 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) { if (!!this.vsDeptUser) {
this.vsDeptUser.scrollToIndex(0, true, 0, 0); this.vsDeptUser.scrollToIndex(0, true, 0, 0);
} }
@ -252,6 +271,9 @@ export class OrganizationComponent
} }
ngOnDestroy(): void { ngOnDestroy(): void {
if (!!this.loginResSubscription) {
this.loginResSubscription.unsubscribe();
}
if (!!this.myDepartmentUserInfoListSubscription) { if (!!this.myDepartmentUserInfoListSubscription) {
this.myDepartmentUserInfoListSubscription.unsubscribe(); this.myDepartmentUserInfoListSubscription.unsubscribe();
} }