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