mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
fix: Replace the bus events with emitter in widget (#9584)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -99,7 +99,7 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
bus.$on(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.toggleReplyTo);
|
||||
this.$emitter.on(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.toggleReplyTo);
|
||||
},
|
||||
methods: {
|
||||
...mapActions('conversation', [
|
||||
|
||||
@@ -97,9 +97,9 @@ export default {
|
||||
},
|
||||
onClickMessage() {
|
||||
if (this.campaignId) {
|
||||
bus.$emit(ON_CAMPAIGN_MESSAGE_CLICK, this.campaignId);
|
||||
this.$emitter.emit(ON_CAMPAIGN_MESSAGE_CLICK, this.campaignId);
|
||||
} else {
|
||||
bus.$emit(ON_UNREAD_MESSAGE_CLICK);
|
||||
this.$emitter.emit(ON_UNREAD_MESSAGE_CLICK);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
openConversationView() {
|
||||
bus.$emit(ON_UNREAD_MESSAGE_CLICK);
|
||||
this.$emitter.emit(ON_UNREAD_MESSAGE_CLICK);
|
||||
},
|
||||
closeFullView() {
|
||||
this.$emit('close');
|
||||
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
this.hasImageError = true;
|
||||
},
|
||||
toggleReply() {
|
||||
bus.$emit(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.message);
|
||||
this.$emitter.emit(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.message);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
|
||||
import { ON_CONVERSATION_CREATED } from 'widget/constants/widgetBusEvents';
|
||||
import { createTemporaryMessage, getNonDeletedMessages } from './helpers';
|
||||
|
||||
import { emitter } from 'shared/helpers/mitt';
|
||||
export const actions = {
|
||||
createConversation: async ({ commit, dispatch }, params) => {
|
||||
commit('setConversationUIFlag', { isCreating: true });
|
||||
@@ -23,7 +23,7 @@ export const actions = {
|
||||
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);
|
||||
emitter.emit(ON_CONVERSATION_CREATED);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
} finally {
|
||||
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
event: 'setCampaignReadOn',
|
||||
});
|
||||
IFrameHelper.sendMessage({ event: 'toggleBubble' });
|
||||
bus.$emit('snooze-campaigns');
|
||||
this.$emitter.emit('snooze-campaigns');
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
},
|
||||
mixins: [configMixin, routerMixin],
|
||||
mounted() {
|
||||
bus.$on(ON_CONVERSATION_CREATED, () => {
|
||||
this.$emitter.on(ON_CONVERSATION_CREATED, () => {
|
||||
// Redirect to messages page after conversation is created
|
||||
this.replaceRoute('messages');
|
||||
});
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
conversationCustomAttributes,
|
||||
}) {
|
||||
if (activeCampaignId) {
|
||||
bus.$emit('execute-campaign', {
|
||||
this.$emitter.emit('execute-campaign', {
|
||||
campaignId: activeCampaignId,
|
||||
customAttributes: conversationCustomAttributes,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user