fix: Change the route change logic based on bus events, after creating a new conversation in the widget. (#8328)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user