sync 오전

This commit is contained in:
Park Byung Eun 2020-04-13 12:57:55 +09:00
parent fa0b17afef
commit b8d60005f0
3 changed files with 132 additions and 1 deletions

View File

@ -1,4 +1,6 @@
uncaught (in promise) error could not instantiate productregistryimpl.registry
list-item.component
refreshItem() 호출
refreshItem() 호출

View File

@ -0,0 +1,129 @@
updateProfileImageNoti$ = createEffect(
() =>
this.actions$.pipe(
ofType(updateProfileImageNoti),
withLatestFrom(
this.store.pipe(
select(
(state: any) =>
state.messenger.sync.room.entities as Dictionary<RoomInfo>
)
),
this.store.pipe(
select(
(state: any) =>
state.messenger.sync.roomUserShort.entities as Dictionary<
RoomUserData
>
)
)
// this.store.pipe(
// select(
// (state: any) => state.messenger.sync.buddy2.syncDate as string
// )
// ),
// this.store.pipe(
// select(
// (state: any) => state.messenger.sync.group2.syncDate as string
// )
// ),
// this.store.pipe(
// select((state: any) => state.messenger.sync.room.syncDate as string)
// )
// tap(async ([action, buddy2SyncDate, group2SyncDate, roomSyncDate]) => {
),
tap(async ([action, roomInfos, roomUserShorts]) => {
const userNoti = action.noti as UserNotification;
// const loginInfo = this.sessionStorageService.get<LoginInfo>(
// KEY_LOGIN_INFO
// );
// this.store.dispatch(buddy2({ syncDate: buddy2SyncDate }));
// this.store.dispatch(group2({ syncDate: group2SyncDate }));
// this.store.dispatch(
// room({
// syncDate: roomSyncDate,
// localeCode: loginInfo.localeCode
// })
// );
this.store.dispatch(
updateBuddyProfile({
noti: userNoti
})
);
for (const key in roomUserShorts) {
if (key === undefined) {
continue;
}
if (roomUserShorts.hasOwnProperty(key)) {
const element = roomUserShorts[key];
const tmpRoomInfo = roomInfos[key];
if (
tmpRoomInfo.roomType === RoomType.Single ||
tmpRoomInfo.roomType === RoomType.Allim_Lbot
) {
const findUser = element.userInfos.filter(
(u) => u.seq === userNoti.SENDER_SEQ
)[0];
if (!!findUser && !!findUser.seq) {
const tmpUserInfos: UserInfoShort[] = [];
element.userInfos.map((u) => {
let user: UserInfoShort;
if (!!u && u.seq === userNoti.SENDER_SEQ) {
user = {
...u,
profileImageFile: userNoti.info
};
} else {
user = u;
}
tmpUserInfos.push(user);
});
const roomData = {
roomSeq: roomInfos[key].roomSeq,
userInfos: tmpUserInfos
} as RoomUserData;
this.store.dispatch(
updateRoomUserShortProfile({
roomData,
noti: userNoti
})
);
break;
}
}
}
}
})
),
{ dispatch: false }
);
// updateProfileImageNoti$ = createEffect(() =>
// this.actions$.pipe(
// ofType(updateProfileImageNoti),
// withLatestFrom(
// this.store.pipe(
// select(
// (state: any) =>
// state.messenger.sync.roomUserShort.entities as Dictionary<
// RoomUserData
// >
// )
// )
// ),
// tap(async ([action, roomUserShorts]) => {
// const userNoti = action.noti as UserNotification;
// })
// )
// );