From 25449965a1b95dff81af80372ea7915365ee5ace Mon Sep 17 00:00:00 2001 From: leejh Date: Tue, 15 Oct 2019 14:40:44 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95=20::=20Sync=20room=20?= =?UTF-8?q?=EC=8B=9C=20entity=20=EC=9D=98=20=EC=A0=95=EB=B3=B4=20upsert=20?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95.=20for=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C=EC=9A=B4=20=EB=B0=A9=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EB=A5=BC=20sync=20=EB=A5=BC=20=ED=86=B5=ED=95=B4=EC=84=9C=20?= =?UTF-8?q?=EC=88=98=EC=A7=91=ED=95=A0=20=EA=B2=BD=EC=9A=B0=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=ED=99=94=20=EA=B0=B1=EC=8B=A0=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95.=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20::=20Sybc=20room=20=EC=8B=9C=20isJoinRoom=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EB=A1=9C=20=EB=82=B4=EA=B0=80=20=EC=B0=B8=EC=97=AC?= =?UTF-8?q?=EC=A4=91=EC=9D=B8=20=EB=8C=80=ED=99=94=EB=B0=A9=EB=A7=8C=20?= =?UTF-8?q?=EC=88=98=EC=A7=91=ED=95=98=EC=97=AC=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EB=A5=BC=20=EA=B5=AC=EC=84=B1=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=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/effects.ts | 4 +++- .../src/app/store/messenger/sync/reducers.ts | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts index 3d8565d2..e437a975 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts @@ -151,7 +151,9 @@ export class Effects { map(res => { switch (res.SSVC_TYPE) { case SSVC_TYPE_SYNC_ROOM_DATA: - roomList.push(...(res as RoomData).roomInfos); + roomList.push( + ...(res as RoomData).roomInfos.filter(v => v.isJoinRoom) + ); break; case SSVC_TYPE_SYNC_ROOM_USER: { 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 f9e02997..eda7bd71 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 @@ -68,14 +68,14 @@ export const reducer = createReducer( return { ...state, - room: adapterRoom.addAll(action.roomList, { + room: adapterRoom.upsertMany(action.roomList, { ...state.room, syncDate: action.syncDate }), - roomUser: adapterRoomUser.addAll(roomUserList, { + roomUser: adapterRoomUser.upsertMany(roomUserList, { ...state.roomUser }), - roomUserShort: adapterRoomUserShort.addAll(roomUserShortList, { + roomUserShort: adapterRoomUserShort.upsertMany(roomUserShortList, { ...state.roomUserShort }) };