diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts index fceb5b62..a783ce1a 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts @@ -117,11 +117,9 @@ export class MessageBoxComponent searchMessageSearchType: [MessageSearchType.Name] }); - this.messageRetrieveList$ = this.store - .pipe( - select(AppStore.MessengerSelector.MessageSelector.selectAllReceiveList) - ) - .pipe(tap(info => console.log(info))); + this.messageRetrieveList$ = this.store.pipe( + select(AppStore.MessengerSelector.MessageSelector.selectAllReceiveList) + ); this.messageSendList$ = this.store.pipe( select(AppStore.MessengerSelector.MessageSelector.selectAllSendList) diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/query/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/query/effects.ts index e9ad9149..0e7d922a 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/query/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/query/effects.ts @@ -88,9 +88,17 @@ export class Effects { userInfos.push(...(res as DeptUserData).userInfos); break; case SSVC_TYPE_QUERY_DEPT_USER_RES: - userInfos.sort((a, b) => { - return a.name < b.name ? -1 : a.name > b.name ? 1 : 0; - }); + userInfos.sort((a, b) => + a.order < b.order + ? -1 + : a.order > b.order + ? 1 + : a.name < b.name + ? -1 + : a.name > b.name + ? 1 + : 0 + ); this.store.dispatch( deptUserSuccess({ diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts index c6e3f073..8238fd93 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts @@ -35,20 +35,9 @@ export const reducer = createReducer( }), on(deptUserSuccess, (state, action) => { - const userList = action.userInfos.sort((a, b) => - a.order < b.order - ? -1 - : a.order > b.order - ? 1 - : a.name < b.name - ? -1 - : a.name > b.name - ? 1 - : 0 - ); return { ...state, - selectedDepartmentUserInfoList: userList, + selectedDepartmentUserInfoList: action.userInfos, selectedDepartmentStatus: action.res, selectedDepartmentProcessing: false };