From aa2bdad471079a173006d7da29b6b3dde081a6dc Mon Sep 17 00:00:00 2001 From: leejinho Date: Thu, 6 Feb 2020 12:51:23 +0900 Subject: [PATCH] =?UTF-8?q?#=20=EC=9D=B4=EC=8A=88=EC=B2=98=EB=A6=AC=20213?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../left-sidenav/message.component.ts | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) 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 11d5b16f..34a470cf 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 @@ -61,6 +61,7 @@ import { } from '../../dialogs/message/message-write.dialog.component'; import { UserInfo } from '@ucap-webmessenger/protocol-sync'; import { EmployeeType } from '@ucap-webmessenger/protocol-room'; +import { map } from 'rxjs/operators'; export interface MessageTypeData { displayName: string; @@ -142,19 +143,39 @@ export class MessageBoxComponent }); this.messageRetrieveList$ = this.store.pipe( - select(AppStore.MessengerSelector.MessageSelector.selectAllReceiveList) + select(AppStore.MessengerSelector.MessageSelector.selectAllReceiveList), + map(list => + list.sort((a, b) => + a.regDate > b.regDate ? -1 : a.regDate < b.regDate ? 1 : 0 + ) + ) ); this.messageSendList$ = this.store.pipe( - select(AppStore.MessengerSelector.MessageSelector.selectAllSendList) + select(AppStore.MessengerSelector.MessageSelector.selectAllSendList), + map(list => + list.sort((a, b) => + a.regDate > b.regDate ? -1 : a.regDate < b.regDate ? 1 : 0 + ) + ) ); this.messageReservationList$ = this.store.pipe( select( AppStore.MessengerSelector.MessageSelector.selectAllReservationList + ), + map(list => + list.sort((a, b) => + a.regDate > b.regDate ? -1 : a.regDate < b.regDate ? 1 : 0 + ) ) ); this.messageSearchList$ = this.store.pipe( - select(AppStore.MessengerSelector.MessageSelector.selectAllSearchList) + select(AppStore.MessengerSelector.MessageSelector.selectAllSearchList), + map(list => + list.sort((a, b) => + a.regDate > b.regDate ? -1 : a.regDate < b.regDate ? 1 : 0 + ) + ) ); this.messageDetailInfo = this.store