diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts index d34120de..c469fcf7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts @@ -31,7 +31,7 @@ import { RetrieveResourceFileRequest, CancelRequest } from '@ucap-webmessenger/api-message'; -import { DeviceType, MimeUtil, FileUtil } from '@ucap-webmessenger/core'; +import { MimeUtil, FileUtil } from '@ucap-webmessenger/core'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { NGXLogger } from 'ngx-logger'; import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; @@ -589,12 +589,23 @@ export class MessageDetailDialogComponent implements OnInit { take(1), map(async res => { if (res.responseCode === MessageStatusCode.Success) { - this.receivers.forEach(user => { - if (cancelUserSeqs.indexOf(user.userSeq) >= 0) { - user.cancelYn = true; - user.readYn = false; - } - }); + this.receivers = [ + ...this.receivers.map(user => { + if (cancelUserSeqs.indexOf(user.userSeq) >= 0) { + return { + userSeq: user.userSeq, + userName: user.userName, + cancelYn: true, + readDate: user.readDate, + readYn: false + }; + } + + return user; + }) + ]; + + this.unReadUsers.deselectAll(); this.selectedUnreadUserSeqs = []; this.rightDrawer.close(); } else { diff --git a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts index 14963bbb..65c861bb 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -112,6 +112,7 @@ import { Dictionary } from '@ngrx/entity'; import { MessageType } from '@ucap-webmessenger/api-message'; import { LogoutInfo, KEY_LOGOUT_INFO } from '@app/types'; import { TranslateService } from '@ngx-translate/core'; +import { deleteMessageSuccess } from '@app/store/messenger/message'; @Injectable() export class AppNotificationService { @@ -657,13 +658,19 @@ export class AppNotificationService { noti ); - console.log('TODO :: remove state logic'); - // // Receive Message List refresh.. - // this.store.dispatch( - // MessageStore.retrieveMessage({ - // messageType: MessageType.Receive - // }) - // ); + // Remove one Receive Message + if (!!noti && !!noti.keyId) { + this.store.dispatch( + deleteMessageSuccess({ + messageType: MessageType.Receive, + msgList: [ + { + msgId: Number(noti.keyId) + } + ] + }) + ); + } } break; diff --git a/projects/ucap-webmessenger-protocol-umg/src/lib/protocols/del-noti.ts b/projects/ucap-webmessenger-protocol-umg/src/lib/protocols/del-noti.ts index 2dd105be..65fcd24a 100644 --- a/projects/ucap-webmessenger-protocol-umg/src/lib/protocols/del-noti.ts +++ b/projects/ucap-webmessenger-protocol-umg/src/lib/protocols/del-noti.ts @@ -12,6 +12,8 @@ export interface UmgDeleteNotiNotification extends ProtocolNotification { senderSeq: number; /** { 송신자정보 } */ senderInfo: SenderInfo; + /** keyID(s) */ + keyId: string; } export const decodeUmgDeleteNotiNotification: ProtocolDecoder = ( @@ -31,6 +33,8 @@ export const decodeUmgDeleteNotiNotification: ProtocolDecoder