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

View File

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