수정 :: Sync room 시 entity 의 정보 upsert 하도록 수정. for 새로운 방정보를 sync 를 통해서 수집할 경우 초기화 갱신되는 문제 수정.

수정 :: Sybc room 시 isJoinRoom 정보로 내가 참여중인 대화방만 수집하여 정보를 구성하도록 수정.
This commit is contained in:
leejh 2019-10-15 14:40:44 +09:00
parent a6b5ac05aa
commit 25449965a1
2 changed files with 6 additions and 4 deletions

View File

@ -151,7 +151,9 @@ export class Effects {
map(res => { map(res => {
switch (res.SSVC_TYPE) { switch (res.SSVC_TYPE) {
case SSVC_TYPE_SYNC_ROOM_DATA: case SSVC_TYPE_SYNC_ROOM_DATA:
roomList.push(...(res as RoomData).roomInfos); roomList.push(
...(res as RoomData).roomInfos.filter(v => v.isJoinRoom)
);
break; break;
case SSVC_TYPE_SYNC_ROOM_USER: case SSVC_TYPE_SYNC_ROOM_USER:
{ {

View File

@ -68,14 +68,14 @@ export const reducer = createReducer(
return { return {
...state, ...state,
room: adapterRoom.addAll(action.roomList, { room: adapterRoom.upsertMany(action.roomList, {
...state.room, ...state.room,
syncDate: action.syncDate syncDate: action.syncDate
}), }),
roomUser: adapterRoomUser.addAll(roomUserList, { roomUser: adapterRoomUser.upsertMany(roomUserList, {
...state.roomUser ...state.roomUser
}), }),
roomUserShort: adapterRoomUserShort.addAll(roomUserShortList, { roomUserShort: adapterRoomUserShort.upsertMany(roomUserShortList, {
...state.roomUserShort ...state.roomUserShort
}) })
}; };