diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index 161d4f12..a8e7a3c3 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -272,6 +272,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { if ( !this.roomInfoSubject.value || (!!this.roomInfoSubject.value && + !!roomInfo && this.roomInfoSubject.value.roomSeq !== roomInfo.roomSeq) ) { this.clearView(); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/status/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/status/effects.ts index 8e5f48fb..f672ba82 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/status/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/status/effects.ts @@ -17,7 +17,14 @@ import { messageUpdate, messageUpdateFailure } from './actions'; -import { tap, switchMap, map, catchError, exhaustMap } from 'rxjs/operators'; +import { + tap, + switchMap, + map, + catchError, + exhaustMap, + delay +} from 'rxjs/operators'; import { StatusProtocolService, SSVC_TYPE_STATUS_BULK_INFO_DATA, @@ -120,14 +127,20 @@ export class Effects { ) ); - myStatusCheck$ = createEffect(() => - this.actions$.pipe( - ofType(AuthStore.loginSuccess), - map(action => action.loginRes), - map(loginRes => { - return bulkInfo({ divCd: 'bulk', userSeqs: [loginRes.userSeq] }); - }) - ) + 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 } ); constructor( diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index c5e56161..5f82ee8c 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -181,7 +181,11 @@ export class MessagesComponent implements OnInit, OnDestroy { this.existReadToHereEvent = true; /** [E] initializing by changed room */ - if (this.roomInfo.roomSeq !== roomInfo.roomSeq) { + if ( + !!this.roomInfo && + !!roomInfo && + this.roomInfo.roomSeq !== roomInfo.roomSeq + ) { this.initEventMore(); } });