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));