From 39aaa78e4e1f303e7f9b796de87f732798b7e6d6 Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 9 Dec 2019 16:25:08 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=A9=20=EB=82=98=EA=B0=80=EA=B8=B0=20?= =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC=20=EC=94=BD=ED=81=AC=20=EC=9E=91?= =?UTF-8?q?=EC=97=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/services/notification.service.ts | 1 + .../src/app/store/messenger/room/effects.ts | 20 +++++++++++++++++-- .../src/lib/services/room-protocol.service.ts | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts index b53ea095..64711b2c 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -378,6 +378,7 @@ export class AppNotificationService { ); } break; + case SSVC_TYPE_ROOM_EXIT_RES: case SSVC_TYPE_ROOM_EXIT_NOTI: { const noti = notiOrRes as ExitNotification; diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/room/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/room/effects.ts index a72c4b2a..3d937630 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/room/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/room/effects.ts @@ -316,8 +316,24 @@ export class Effects { () => { return this.actions$.pipe( ofType(exitNotification), - map(action => action.noti), - tap(noti => {}) + withLatestFrom( + this.store.pipe( + select((state: any) => state.messenger.room.roomInfo as RoomInfo) + ) + ), + tap(([action, roomInfo]) => { + if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) { + this.store.dispatch(ChatStore.clearSelectedRoom()); + } + + this.store.dispatch( + exitSuccess({ + res: { + roomSeq: action.noti.roomSeq + } + }) + ); + }) ); }, { dispatch: false } diff --git a/projects/ucap-webmessenger-protocol-room/src/lib/services/room-protocol.service.ts b/projects/ucap-webmessenger-protocol-room/src/lib/services/room-protocol.service.ts index 124e70a0..091d98fa 100644 --- a/projects/ucap-webmessenger-protocol-room/src/lib/services/room-protocol.service.ts +++ b/projects/ucap-webmessenger-protocol-room/src/lib/services/room-protocol.service.ts @@ -145,6 +145,7 @@ export class RoomProtocolService { ); } break; + case SSVC_TYPE_ROOM_EXIT_RES: case SSVC_TYPE_ROOM_EXIT_NOTI: { this.notificationSubject.next(decodeExitNotification(message));