bugfix :: 간헐적으로 프레즌스 적용안되는 문제 수정.

This commit is contained in:
leejinho 2020-04-03 09:49:14 +09:00
parent 89a99d20d3
commit 4d816c6e54
2 changed files with 36 additions and 22 deletions

View File

@ -36,6 +36,9 @@ import {
MessageUpdateResponse
} from '@ucap-webmessenger/protocol-status';
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';
@Injectable()
export class Effects {
@ -48,6 +51,14 @@ export class Effects {
userSeqList.push(buddy.seq);
}
const loginResInfo: LoginResponse = this.sessionStorageService.get<
LoginResponse
>(KEY_LOGIN_RES_INFO);
if (!!loginResInfo) {
// import my status.
userSeqList.push(loginResInfo.userSeq);
}
return bulkInfo({ divCd: 'bulk', userSeqs: userSeqList });
})
)
@ -128,23 +139,23 @@ export class Effects {
)
);
myStatusCheck$ = createEffect(
() =>
this.actions$.pipe(
ofType(AuthStore.loginSuccess),
map(action => action.loginRes),
delay(5000),
tap(loginRes => {
this.store.dispatch(
bulkInfo({ divCd: 'mybulk', userSeqs: [loginRes.userSeq] })
);
// return bulkInfo({ divCd: 'bulk', userSeqs: [loginRes.userSeq] });
})
),
{ dispatch: false }
);
// myStatusCheck$ = createEffect(
// () =>
// this.actions$.pipe(
// ofType(AuthStore.loginSuccess),
// map(action => action.loginRes),
// delay(5000),
// tap(loginRes => {
// this.store.dispatch(
// bulkInfo({ divCd: 'mybulk', userSeqs: [loginRes.userSeq] })
// );
// // return bulkInfo({ divCd: 'bulk', userSeqs: [loginRes.userSeq] });
// })
// ),
// { dispatch: false }
// );
mroomUserStatusCheck$ = createEffect(
roomUserStatusCheck$ = createEffect(
() =>
this.actions$.pipe(
ofType(RoomStore.infoSuccess),
@ -167,6 +178,7 @@ export class Effects {
private actions$: Actions,
private store: Store<any>,
private statusProtocolService: StatusProtocolService,
private sessionStorageService: SessionStorageService,
private logger: NGXLogger
) {}
}

View File

@ -35,22 +35,24 @@ export const reducer = createReducer(
const noti = action.noti;
const statusBulkInfoState: StatusBulkInfo = {
...state.statusBulkInfo.entities[noti.userSeq],
userSeq: noti.userSeq,
conferenceStatus: noti.conferenceStatus,
imessengerStatus: noti.imessengerStatus,
mobileConferenceStatus: noti.mobileConferenceStatus,
mobileStatus: noti.mobileStatus,
pcStatus: noti.pcStatus,
phoneStatus: noti.phoneStatus,
statusMessage: noti.statusMessage
statusMessage: noti.statusMessage,
terminalStatus: TerminalStatusInfo.Unknown,
terminalStatusNumber: TerminalStatusNumber.Unknown,
workstatus: noti.workstatus
};
return {
...state,
statusBulkInfo: adapterStatusBulkInfo.updateOne(
{ id: noti.userSeq, changes: statusBulkInfoState },
{ ...state.statusBulkInfo }
)
statusBulkInfo: adapterStatusBulkInfo.upsertOne(statusBulkInfoState, {
...state.statusBulkInfo
})
};
}),