From d219226aa3fc9a92caf07ce769a82ed67c03a091 Mon Sep 17 00:00:00 2001 From: leejinho Date: Fri, 3 Apr 2020 11:39:49 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8C=80=ED=99=94=EB=B0=A9=20=EC=A7=84?= =?UTF-8?q?=EC=9E=85=EC=8B=9C=20=EB=8C=80=ED=99=94=EC=B0=B8=EC=97=AC?= =?UTF-8?q?=EC=9E=90=20=ED=94=84=EB=A0=88=EC=A6=8C=EC=8A=A4=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EB=A1=9C=EC=A7=81=20=EA=B0=9C=EC=84=A0.=20>>=20=20?= =?UTF-8?q?=EB=82=B4=20=ED=94=84=EB=A0=88=EC=A6=8C=EC=8A=A4=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=A0=9C=EC=99=B8,=20=ED=98=84=EC=9E=AC=20?= =?UTF-8?q?=EB=B0=A9=20=EC=B0=B8=EC=97=AC=EC=9D=B8=EC=9B=90=EB=A7=8C=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/store/messenger/status/effects.ts | 40 ++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/status/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/status/effects.ts index bb2ee150..57b578b5 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/status/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/status/effects.ts @@ -39,6 +39,7 @@ import { of } from 'rxjs'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { KEY_LOGIN_RES_INFO } from '@app/types'; +import { RoomType } from '@ucap-webmessenger/protocol-room'; @Injectable() export class Effects { @@ -159,15 +160,36 @@ export class Effects { () => this.actions$.pipe( ofType(RoomStore.infoSuccess), - map(action => action.userInfoList), - tap(userInfoList => { - if (!!userInfoList && userInfoList.length > 0) { - this.store.dispatch( - bulkInfo({ - divCd: 'roomuserBulk', - userSeqs: userInfoList.map(userinfo => userinfo.seq) - }) - ); + // map(action => action.userInfoList), + tap(action => { + if ( + !!action.userInfoList && + action.userInfoList.length > 0 && + (action.roomInfo.roomType === RoomType.Single || + action.roomInfo.roomType === RoomType.Multi) + ) { + let userSeqs = action.userInfoList + .filter(userInfo => userInfo.isJoinRoom) + .map(userinfo => userinfo.seq); + + // ignore my state. + const loginResInfo: LoginResponse = this.sessionStorageService.get< + LoginResponse + >(KEY_LOGIN_RES_INFO); + if (!!loginResInfo) { + userSeqs = userSeqs.filter( + userSeq => userSeq !== loginResInfo.userSeq + ); + } + + if (!!userSeqs && userSeqs.length > 0) { + this.store.dispatch( + bulkInfo({ + divCd: 'roomuserBulk', + userSeqs + }) + ); + } } }) ),