From 9fea3a1f22c4d28cbf26bf9b5a0b2640db964d5f Mon Sep 17 00:00:00 2001 From: leejinho Date: Thu, 6 Feb 2020 14:34:42 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=81=EB=8C=80=EB=B0=A9=EC=9D=B4=20?= =?UTF-8?q?=ED=87=B4=EC=9E=A5=20=ED=96=88=EC=9D=84=EB=95=8C=20sync=20?= =?UTF-8?q?=EC=AA=BD=20user=20list=20=EA=B0=B1=EC=8B=A0=ED=95=98=EB=A9=B4?= =?UTF-8?q?=EC=84=9C=20room=20=EC=97=90=20joincount=20=EA=B0=B1=EC=8B=A0?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/store/messenger/sync/reducers.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts index ea6d0eed..8c645c5c 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts @@ -103,6 +103,8 @@ export const reducer = createReducer( }), on(clearRoomUsers, (state, action) => { + const roomInfo = state.room.entities[action.roomSeq]; + const roomUserList: RoomUserDetailData = { ...state.roomUser.entities[action.roomSeq] }; @@ -149,6 +151,15 @@ export const reducer = createReducer( return { ...state, + room: adapterRoom.upsertOne( + { + ...roomInfo, + joinUserCount: roomInfo.joinUserCount - action.userSeqs.length + }, + { + ...state.room + } + ), roomUser: !!trgtRoomUserList ? adapterRoomUser.upsertOne(trgtRoomUserList, { ...state.roomUser