bugfix :: sync room > userinfo

This commit is contained in:
leejinho 2020-02-18 10:16:10 +09:00
parent 87cbb1b6b5
commit 40298cdba2

View File

@ -223,11 +223,6 @@ export class Effects {
case SSVC_TYPE_SYNC_ROOM_USER:
{
const roomUserData = res as RoomUserData;
if (
roomList.length > 0 &&
roomList.filter(r => r.roomSeq === roomUserData.roomSeq)
.length > 0
) {
if (!roomUserInfoMap[roomUserData.roomSeq]) {
roomUserInfoMap[roomUserData.roomSeq] = {
userInfoList: [],
@ -238,17 +233,10 @@ export class Effects {
roomUserData.roomSeq
].userInfoShortList.push(...roomUserData.userInfos);
}
}
break;
case SSVC_TYPE_SYNC_ROOM_USER2:
{
const roomUserDetailData = res as RoomUserDetailData;
if (
roomList.length > 0 &&
roomList.filter(
r => r.roomSeq === roomUserDetailData.roomSeq
).length > 0
) {
if (!roomUserInfoMap[roomUserDetailData.roomSeq]) {
roomUserInfoMap[roomUserDetailData.roomSeq] = {
userInfoList: [],
@ -259,14 +247,31 @@ export class Effects {
roomUserDetailData.roomSeq
].userInfoList.push(...roomUserDetailData.userInfos);
}
}
break;
case SSVC_TYPE_SYNC_ROOM_RES:
{
const tmpRoomUserInfoMap: {
[param: string]: {
userInfoShortList: UserInfoShort[];
userInfoList: RoomUserInfo[];
};
} = {};
roomList.forEach(roomInfo => {
for (const key in roomUserInfoMap) {
if (
key === roomInfo.roomSeq &&
roomUserInfoMap.hasOwnProperty(key)
) {
tmpRoomUserInfoMap[key] = roomUserInfoMap[key];
}
}
});
this.store.dispatch(
roomSuccess({
roomList,
roomUserInfoMap,
roomUserInfoMap: tmpRoomUserInfoMap,
syncDate: (res as RoomResponse).syncDate
})
);