mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
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 <pranav@chatwoot.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -55,15 +55,8 @@ export default {
|
|||||||
emitter.on(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.toggleReplyTo);
|
emitter.on(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.toggleReplyTo);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions('conversation', [
|
...mapActions('conversation', ['sendMessage', 'sendAttachment']),
|
||||||
'sendMessage',
|
...mapActions('conversationAttributes', ['getAttributes']),
|
||||||
'sendAttachment',
|
|
||||||
'clearConversations',
|
|
||||||
]),
|
|
||||||
...mapActions('conversationAttributes', [
|
|
||||||
'getAttributes',
|
|
||||||
'clearConversationAttributes',
|
|
||||||
]),
|
|
||||||
async handleSendMessage(content) {
|
async handleSendMessage(content) {
|
||||||
await this.sendMessage({
|
await this.sendMessage({
|
||||||
content,
|
content,
|
||||||
@@ -84,8 +77,6 @@ export default {
|
|||||||
this.inReplyTo = null;
|
this.inReplyTo = null;
|
||||||
},
|
},
|
||||||
startNewConversation() {
|
startNewConversation() {
|
||||||
this.clearConversations();
|
|
||||||
this.clearConversationAttributes();
|
|
||||||
this.replaceRoute('prechat-form');
|
this.replaceRoute('prechat-form');
|
||||||
IFrameHelper.sendMessage({
|
IFrameHelper.sendMessage({
|
||||||
event: 'onEvent',
|
event: 'onEvent',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import { mapActions } from 'vuex';
|
||||||
import PreChatForm from '../components/PreChat/Form.vue';
|
import PreChatForm from '../components/PreChat/Form.vue';
|
||||||
import configMixin from '../mixins/configMixin';
|
import configMixin from '../mixins/configMixin';
|
||||||
import routerMixin from '../mixins/routerMixin';
|
import routerMixin from '../mixins/routerMixin';
|
||||||
@@ -19,6 +20,8 @@ export default {
|
|||||||
emitter.off(ON_CONVERSATION_CREATED, this.handleConversationCreated);
|
emitter.off(ON_CONVERSATION_CREATED, this.handleConversationCreated);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapActions('conversation', ['clearConversations']),
|
||||||
|
...mapActions('conversationAttributes', ['clearConversationAttributes']),
|
||||||
handleConversationCreated() {
|
handleConversationCreated() {
|
||||||
// Redirect to messages page after conversation is created
|
// Redirect to messages page after conversation is created
|
||||||
this.replaceRoute('messages');
|
this.replaceRoute('messages');
|
||||||
@@ -48,6 +51,8 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.clearConversations();
|
||||||
|
this.clearConversationAttributes();
|
||||||
this.$store.dispatch('conversation/createConversation', {
|
this.$store.dispatch('conversation/createConversation', {
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
emailAddress: emailAddress,
|
emailAddress: emailAddress,
|
||||||
|
|||||||
Reference in New Issue
Block a user