[21 전달된 메시지 바로 보여지지 않음] 대화방 선택 전달시 발생할 소지 있음 :: 비동기처리방식을 동기처리 방식으로 수정.

This commit is contained in:
leejinho 2019-11-22 15:19:47 +09:00
parent a0f0cd28a7
commit c67dc1ca9c

View File

@ -101,6 +101,7 @@ import {
InfoResponse as FileInfoResponse,
FileType
} from '@ucap-webmessenger/protocol-file';
import { RoomUserData } from '@ucap-webmessenger/protocol-sync';
@Injectable()
export class Effects {
@ -393,21 +394,41 @@ export class Effects {
() => {
return this.actions$.pipe(
ofType(forward),
map(action => {
withLatestFrom(
this.store.pipe(
select(
(state: any) =>
state.messenger.sync.roomUserShort.entities as Dictionary<
RoomUserData
>
)
)
),
tap(([action, roomUserList]) => {
if (!!action.trgtRoomSeq) {
this.store.dispatch(
ChatStore.selectedRoom({ roomSeq: action.trgtRoomSeq })
);
this.store.dispatch(
send({
forwardAfterRoomOpen({
senderSeq: action.senderSeq,
req: {
roomSeq: action.trgtRoomSeq,
eventType: action.req.eventType,
sentMessage: action.req.sentMessage
}
req: action.req,
trgtUserSeqs: roomUserList[action.trgtRoomSeq].userInfos.map(
user => user.seq
)
})
);
// this.store.dispatch(
// ChatStore.selectedRoom({ roomSeq: action.trgtRoomSeq })
// );
// this.store.dispatch(
// send({
// senderSeq: action.senderSeq,
// req: {
// roomSeq: action.trgtRoomSeq,
// eventType: action.req.eventType,
// sentMessage: action.req.sentMessage
// }
// })
// );
} else if (!!action.trgtUserSeqs && action.trgtUserSeqs.length > 0) {
// 방오픈 후 대화전달.
this.store.dispatch(forwardAfterRoomOpen(action));