diff --git a/app/javascript/dashboard/components/widgets/conversation/Message.vue b/app/javascript/dashboard/components/widgets/conversation/Message.vue index 4b374c16d..5ebd08ccb 100644 --- a/app/javascript/dashboard/components/widgets/conversation/Message.vue +++ b/app/javascript/dashboard/components/widgets/conversation/Message.vue @@ -150,6 +150,8 @@ import { MESSAGE_TYPE, MESSAGE_STATUS } from 'shared/constants/messages'; import { generateBotMessageContent } from './helpers/botMessageContentHelper'; import { BUS_EVENTS } from 'shared/constants/busEvents'; import { ACCOUNT_EVENTS } from 'dashboard/helper/AnalyticsHelper/events'; +import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage'; +import { LocalStorage } from 'shared/helpers/localStorage'; export default { components: { @@ -500,7 +502,13 @@ export default { this.showContextMenu = false; this.contextMenuPosition = { x: null, y: null }; }, - handleReplyTo() {}, + handleReplyTo() { + const replyStorageKey = LOCAL_STORAGE_KEYS.MESSAGE_REPLY_TO; + const { conversation_id: conversationId, id: replyTo } = this.data; + + LocalStorage.updateJsonStore(replyStorageKey, conversationId, replyTo); + bus.$emit(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.data); + }, setupHighlightTimer() { if (Number(this.$route.query.messageId) !== Number(this.data.id)) { return; diff --git a/app/javascript/dashboard/constants/localStorage.js b/app/javascript/dashboard/constants/localStorage.js index 21360e178..ee6a4357a 100644 --- a/app/javascript/dashboard/constants/localStorage.js +++ b/app/javascript/dashboard/constants/localStorage.js @@ -4,4 +4,5 @@ export const LOCAL_STORAGE_KEYS = { DRAFT_MESSAGES: 'draftMessages', COLOR_SCHEME: 'color_scheme', DISMISSED_LABEL_SUGGESTIONS: 'labelSuggestionsDismissed', + MESSAGE_REPLY_TO: 'messageReplyTo', }; diff --git a/app/javascript/shared/constants/busEvents.js b/app/javascript/shared/constants/busEvents.js index 6c9a21072..ebd229ed4 100644 --- a/app/javascript/shared/constants/busEvents.js +++ b/app/javascript/shared/constants/busEvents.js @@ -9,5 +9,6 @@ export const BUS_EVENTS = { TOGGLE_SIDEMENU: 'TOGGLE_SIDEMENU', ON_MESSAGE_LIST_SCROLL: 'ON_MESSAGE_LIST_SCROLL', WEBSOCKET_DISCONNECT: 'WEBSOCKET_DISCONNECT', + TOGGLE_REPLY_TO_MESSAGE: 'TOGGLE_REPLY_TO_MESSAGE', SHOW_TOAST: 'newToastMessage', };