From 8e43d5599b1d10b8dc993e1799022e952de6d54c Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 25 Mar 2020 12:12:36 +0900 Subject: [PATCH] =?UTF-8?q?bugfix=20::=201:1=EB=8C=80=ED=99=94=EB=B0=A9?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=83=81=EB=8C=80=EB=B0=A9=EC=9D=B4=20?= =?UTF-8?q?=EB=B0=A9=EB=82=98=EA=B0=80=EA=B8=B0=20=ED=96=88=EC=9D=84=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EB=8C=80=ED=99=94=EC=83=81=EB=8C=80?= =?UTF-8?q?=EC=97=86=EC=9D=8C=20=EC=9C=BC=EB=A1=9C=20=EB=82=98=EC=98=A4?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/left-sidenav/chat.component.ts | 14 +++++++--- .../right-drawer/room-user-list.component.ts | 26 ++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts index 0dd8874f..87c54e4c 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts @@ -20,7 +20,8 @@ import { Subscription, combineLatest, Observable } from 'rxjs'; import { RoomInfo, UserInfoShort, - UserInfo as RoomUserInfo + UserInfo as RoomUserInfo, + RoomType } from '@ucap-webmessenger/protocol-room'; import * as AppStore from '@app/store'; import * as ChatStore from '@app/store/messenger/chat'; @@ -288,9 +289,14 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked { value => roomInfo.roomSeq === value.roomSeq ); if (-1 < i) { - return this.roomUserShortList[i].userInfos.filter( - user => user.isJoinRoom - ); + if (roomInfo.roomType === RoomType.Single) { + // Ignore type of joinRoom for Single Room. + return this.roomUserShortList[i].userInfos; + } else { + return this.roomUserShortList[i].userInfos.filter( + user => user.isJoinRoom + ); + } } } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts index 647c15aa..d0317acf 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts @@ -6,7 +6,7 @@ import { EventEmitter, ViewChild } from '@angular/core'; -import { Subscription } from 'rxjs'; +import { Subscription, combineLatest } from 'rxjs'; import { Store, select } from '@ngrx/store'; import { tap, map, take } from 'rxjs/operators'; @@ -86,16 +86,22 @@ export class RoomUserListComponent implements OnInit, OnDestroy { } ngOnInit() { - this.userInfoListSubscription = this.store - .pipe( - select(AppStore.MessengerSelector.RoomSelector.selectUserinfolist), - tap(userInfoList => { - this.userInfoList = userInfoList - .filter(userInfo => userInfo.isJoinRoom === true) - .sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0)); + this.userInfoListSubscription = combineLatest([ + this.store.pipe( + select(AppStore.MessengerSelector.RoomSelector.selectUserinfolist) + ), + this.store.pipe(select(AppStore.MessengerSelector.RoomSelector.roomInfo)) + ]).subscribe(([userInfoList, roomInfo]) => { + this.userInfoList = userInfoList + .filter(userInfo => { + if (roomInfo.roomType === RoomType.Single) { + return true; + } else { + return userInfo.isJoinRoom === true; + } }) - ) - .subscribe(); + .sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0)); + }); this.roomInfoSubscription = this.store .pipe(