쪽지 발송 취소시 발송취소 대상의 리스트에서 삭제 해 주는 로직 추가.

This commit is contained in:
leejinho 2020-01-10 15:58:02 +09:00
parent 831283c10a
commit 0812e064a8
3 changed files with 37 additions and 15 deletions

View File

@ -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 => {
this.receivers = [
...this.receivers.map(user => {
if (cancelUserSeqs.indexOf(user.userSeq) >= 0) {
user.cancelYn = true;
user.readYn = false;
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 {

View File

@ -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;

View File

@ -12,6 +12,8 @@ export interface UmgDeleteNotiNotification extends ProtocolNotification {
senderSeq: number;
/** { 송신자정보 } */
senderInfo: SenderInfo;
/** keyID(s) */
keyId: string;
}
export const decodeUmgDeleteNotiNotification: ProtocolDecoder<UmgDeleteNotiNotification> = (
@ -31,6 +33,8 @@ export const decodeUmgDeleteNotiNotification: ProtocolDecoder<UmgDeleteNotiNotif
/** 송신자SEQ(n) */
senderSeq: Number(message.bodyList[0]),
/** { 송신자정보 } */
senderInfo
senderInfo,
/** keyID(s) */
keyId: message.bodyList[2]
} as UmgDeleteNotiNotification);
};