From faf35738b3b0010ca151ef77340e4a7c987d5e59 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 19 Aug 2025 12:06:22 +0530 Subject: [PATCH 1/3] fix: Prevent reopening a resolved conversation (#11168) # Pull Request Template ## Description This PR addresses the issue where navigating back and starting a new conversation incorrectly shows the previous messages or message screen. Fixes https://linear.app/chatwoot/issue/CW-4169/prevent-continue-conversation-in-previously-resolved-conversation ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ### Loom video **Before** https://www.loom.com/share/18172a3b26ff4e8faf8e1c3c1a0ba279?sid=ffbda52a-93e1-400f-bedc-17b925bae4d3 **After** https://www.loom.com/share/584177d411424ad38c6812be868eb060?sid=fe5e771a-3faa-4c14-a5fe-918a3ccdb408 ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Pranav Co-authored-by: Muhsin Keloth --- app/javascript/widget/components/ChatFooter.vue | 13 ++----------- app/javascript/widget/views/PreChatForm.vue | 5 +++++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/javascript/widget/components/ChatFooter.vue b/app/javascript/widget/components/ChatFooter.vue index 841b37216..2bc6ba7ec 100755 --- a/app/javascript/widget/components/ChatFooter.vue +++ b/app/javascript/widget/components/ChatFooter.vue @@ -55,15 +55,8 @@ export default { emitter.on(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.toggleReplyTo); }, methods: { - ...mapActions('conversation', [ - 'sendMessage', - 'sendAttachment', - 'clearConversations', - ]), - ...mapActions('conversationAttributes', [ - 'getAttributes', - 'clearConversationAttributes', - ]), + ...mapActions('conversation', ['sendMessage', 'sendAttachment']), + ...mapActions('conversationAttributes', ['getAttributes']), async handleSendMessage(content) { await this.sendMessage({ content, @@ -84,8 +77,6 @@ export default { this.inReplyTo = null; }, startNewConversation() { - this.clearConversations(); - this.clearConversationAttributes(); this.replaceRoute('prechat-form'); IFrameHelper.sendMessage({ event: 'onEvent', diff --git a/app/javascript/widget/views/PreChatForm.vue b/app/javascript/widget/views/PreChatForm.vue index 8eac55808..ca25b47e4 100644 --- a/app/javascript/widget/views/PreChatForm.vue +++ b/app/javascript/widget/views/PreChatForm.vue @@ -1,4 +1,5 @@ + + diff --git a/app/javascript/dashboard/i18n/locale/en/contact.json b/app/javascript/dashboard/i18n/locale/en/contact.json index 4f0a27cae..a5c9549f1 100644 --- a/app/javascript/dashboard/i18n/locale/en/contact.json +++ b/app/javascript/dashboard/i18n/locale/en/contact.json @@ -17,6 +17,11 @@ "IP_ADDRESS": "IP Address", "CREATED_AT_LABEL": "Created", "NEW_MESSAGE": "New message", + "CALL": "Call", + "CALL_UNDER_DEVELOPMENT": "Calling is under development", + "VOICE_INBOX_PICKER": { + "TITLE": "Choose a voice inbox" + }, "CONVERSATIONS": { "NO_RECORDS_FOUND": "There are no previous conversations associated to this contact.", "TITLE": "Previous Conversations" diff --git a/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactInfo.vue b/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactInfo.vue index 327bc95ae..bfdb5d68a 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactInfo.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactInfo.vue @@ -11,6 +11,7 @@ import ContactMergeModal from 'dashboard/modules/contact/ContactMergeModal.vue'; import ComposeConversation from 'dashboard/components-next/NewConversation/ComposeConversation.vue'; import { BUS_EVENTS } from 'shared/constants/busEvents'; import NextButton from 'dashboard/components-next/button/Button.vue'; +import VoiceCallButton from 'dashboard/components-next/Contacts/VoiceCallButton.vue'; import { isAConversationRoute, @@ -28,6 +29,7 @@ export default { ComposeConversation, SocialIcons, ContactMergeModal, + VoiceCallButton, }, props: { contact: { @@ -278,6 +280,14 @@ export default { /> +