fix: Change the route change logic based on bus events, after creating a new conversation in the widget. (#8328)

This commit is contained in:
Muhsin Keloth
2023-11-10 09:44:59 +05:30
committed by GitHub
parent 1948bef9ac
commit c1a2e67c9e
3 changed files with 10 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ import {
deleteCustomAttribute,
} from 'widget/api/conversation';
import { ON_CONVERSATION_CREATED } from 'widget/constants/widgetBusEvents';
import { createTemporaryMessage, getNonDeletedMessages } from './helpers';
export const actions = {
@@ -21,6 +22,8 @@ export const actions = {
const [message = {}] = messages;
commit('pushMessageToConversation', message);
dispatch('conversationAttributes/getAttributes', {}, { root: true });
// Emit event to notify that conversation is created and show the chat screen
bus.$emit(ON_CONVERSATION_CREATED);
} catch (error) {
// Ignore error
} finally {