mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
@@ -4,6 +4,7 @@ import getters, { getSelectedChatConversation } from './getters';
|
||||
import actions from './actions';
|
||||
import { findPendingMessageIndex } from './helpers';
|
||||
import wootConstants from '../../../constants';
|
||||
import { BUS_EVENTS } from '../../../../shared/constants/busEvents';
|
||||
|
||||
const state = {
|
||||
allConversations: [],
|
||||
@@ -108,7 +109,7 @@ export const mutations = {
|
||||
chat.messages.push(message);
|
||||
chat.timestamp = message.created_at;
|
||||
if (selectedChatId === conversationId) {
|
||||
window.bus.$emit('scrollToMessage');
|
||||
window.bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -130,7 +131,7 @@ export const mutations = {
|
||||
};
|
||||
Vue.set(allConversations, currentConversationIndex, currentConversation);
|
||||
if (_state.selectedChatId === conversation.id) {
|
||||
window.bus.$emit('scrollToMessage');
|
||||
window.bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE);
|
||||
}
|
||||
} else {
|
||||
_state.allConversations.push(conversation);
|
||||
|
||||
@@ -120,7 +120,7 @@ describe('#mutations', () => {
|
||||
timestamp: 1602256198,
|
||||
},
|
||||
]);
|
||||
expect(global.bus.$emit).toHaveBeenCalledWith('scrollToMessage');
|
||||
expect(global.bus.$emit).toHaveBeenCalledWith('SCROLL_TO_MESSAGE');
|
||||
});
|
||||
|
||||
it('update message if it exist in the store', () => {
|
||||
|
||||
Reference in New Issue
Block a user