대화방 진입시 대화참여자 프레즌스 조회 로직 개선. >> 내 프레즌스 조회 제외, 현재 방 참여인원만 조회.

This commit is contained in:
leejinho 2020-04-03 11:39:49 +09:00
parent 9269906f35
commit d219226aa3

View File

@ -39,6 +39,7 @@ import { of } from 'rxjs';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { KEY_LOGIN_RES_INFO } from '@app/types';
import { RoomType } from '@ucap-webmessenger/protocol-room';
@Injectable()
export class Effects {
@ -159,16 +160,37 @@ export class Effects {
() =>
this.actions$.pipe(
ofType(RoomStore.infoSuccess),
map(action => action.userInfoList),
tap(userInfoList => {
if (!!userInfoList && userInfoList.length > 0) {
// map(action => action.userInfoList),
tap(action => {
if (
!!action.userInfoList &&
action.userInfoList.length > 0 &&
(action.roomInfo.roomType === RoomType.Single ||
action.roomInfo.roomType === RoomType.Multi)
) {
let userSeqs = action.userInfoList
.filter(userInfo => userInfo.isJoinRoom)
.map(userinfo => userinfo.seq);
// ignore my state.
const loginResInfo: LoginResponse = this.sessionStorageService.get<
LoginResponse
>(KEY_LOGIN_RES_INFO);
if (!!loginResInfo) {
userSeqs = userSeqs.filter(
userSeq => userSeq !== loginResInfo.userSeq
);
}
if (!!userSeqs && userSeqs.length > 0) {
this.store.dispatch(
bulkInfo({
divCd: 'roomuserBulk',
userSeqs: userInfoList.map(userinfo => userinfo.seq)
userSeqs
})
);
}
}
})
),
{ dispatch: false }