diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts index df5ee4a7..82848c10 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts @@ -149,6 +149,13 @@ export class MessageBoxComponent // Badge Refresh in case Receive Message.. if (info.msgInfo.type === MessageType.Receive) { this.doRefreshUnReadCount.emit(); + + // Clear Receive Message New Badge.. + this.store.dispatch( + MessageStore.clearNewFlagReceiveMessage({ + msgId: info.msgInfo.msgId + }) + ); } // detail view.. 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 72f4e1e9..982c6e34 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 @@ -1303,6 +1303,33 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { } break; case EventType.Translation: + { + let trgtStr = ''; + if (clicktype === 'translation') { + // translation + trgtStr = (message.sentMessageJson as TranslationEventJson) + .translation; + } else { + // original + trgtStr = (message.sentMessageJson as TranslationEventJson) + .original; + } + + if (this.clipboardService.copyFromContent(trgtStr)) { + this.snackBarService.open( + this.translateService.instant( + 'common.clipboard.results.copied' + ), + '', + { + duration: 3000, + verticalPosition: 'top', + horizontalPosition: 'center' + } + ); + } + } + break; case EventType.MassTranslation: { const sentMessageJson: MassTranslationEventJson = message.sentMessageJson as MassTranslationEventJson; 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 65c861bb..982719d7 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -660,6 +660,10 @@ export class AppNotificationService { // Remove one Receive Message if (!!noti && !!noti.keyId) { + // clear badge in left navi + this.store.dispatch(MessageStore.retrieveUnreadCount({})); + + // delete message in receive message list this.store.dispatch( deleteMessageSuccess({ messageType: MessageType.Receive, diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/message/actions.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/message/actions.ts index ea0f45c2..1c392131 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/message/actions.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/message/actions.ts @@ -122,3 +122,8 @@ export const clearSearchMessage = createAction( '[Messenger::Message] Clear Search Message', props() ); + +export const clearNewFlagReceiveMessage = createAction( + '[Messenger::Message] Clear NewFlag Message', + props<{ msgId: number }>() +); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/message/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/message/reducers.ts index 05d061dd..53c67bf1 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/message/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/message/reducers.ts @@ -18,9 +18,10 @@ import { detailMessageSuccess, detailMessageClear, detailMessage, - clearSearchMessage + clearSearchMessage, + clearNewFlagReceiveMessage } from './actions'; -import { MessageType } from '@ucap-webmessenger/api-message'; +import { MessageType, MessageList } from '@ucap-webmessenger/api-message'; export const reducer = createReducer( initialState, @@ -149,6 +150,22 @@ export const reducer = createReducer( }; }), + on(clearNewFlagReceiveMessage, (state, action) => { + const msgId = action.msgId; + const msgList: MessageList = { + ...state.receiveList.entities[msgId], + readYn: true + }; + + return { + ...state, + receiveList: adapterReceiveList.updateOne( + { id: msgId, changes: msgList }, + { ...state.receiveList } + ) + }; + }), + on(cancelReservationMessageSuccess, (state, action) => { return { ...state, diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json index ada7438e..0d88386b 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json @@ -266,7 +266,7 @@ "sendingTime": "보낸 시간", "reservationTime": "발송 예정 시간", "countOfReadUser": "읽은 사람", - "countOfUnreadUser": "읽은 않은 사람", + "countOfUnreadUser": "읽지 않은 사람", "badgeDescriptionForUnread": "확인하지 않은 쪽지가 있습니다.", "cancelReservation": "예약 발송 취소", "cancelSending": "발송 취소",