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