Chore: Move conversationStats to a seperate module (#962)
* Chore: Move conversationStats to a seperate module * Move toggleTyping to conversationTypingStatus * Remove unused agentTyping flag * Fix review comments
This commit is contained in:
@@ -88,14 +88,17 @@ export default {
|
||||
chatListLoading: 'getChatListLoadingStatus',
|
||||
currentUserID: 'getCurrentUserID',
|
||||
activeInbox: 'getSelectedInbox',
|
||||
convStats: 'getConvTabStats',
|
||||
conversationStats: 'conversationStats/getStats',
|
||||
}),
|
||||
assigneeTabItems() {
|
||||
return this.$t('CHAT_LIST.ASSIGNEE_TYPE_TABS').map(item => ({
|
||||
key: item.KEY,
|
||||
name: item.NAME,
|
||||
count: this.convStats[item.COUNT_KEY] || 0,
|
||||
}));
|
||||
return this.$t('CHAT_LIST.ASSIGNEE_TYPE_TABS').map(item => {
|
||||
const count = this.conversationStats[item.COUNT_KEY] || 0;
|
||||
return {
|
||||
key: item.KEY,
|
||||
name: item.NAME,
|
||||
count,
|
||||
};
|
||||
});
|
||||
},
|
||||
inbox() {
|
||||
return this.$store.getters['inboxes/getInbox'](this.activeInbox);
|
||||
@@ -130,7 +133,7 @@ export default {
|
||||
this.$store.dispatch('agents/get');
|
||||
|
||||
bus.$on('fetch_conversation_stats', () => {
|
||||
this.$store.dispatch('getConversationStats', this.conversationFilters);
|
||||
this.$store.dispatch('conversationStats/get', this.conversationFilters);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -22,11 +22,6 @@ export default {
|
||||
default: wootConstants.ASSIGNEE_TYPE.ME,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabsIndex: wootConstants.ASSIGNEE_TYPE.ME,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
activeTabIndex() {
|
||||
return this.items.findIndex(item => item.key === this.activeTab);
|
||||
|
||||
@@ -269,7 +269,7 @@ export default {
|
||||
toggleTyping(status) {
|
||||
if (this.channelType === 'Channel::WebWidget' && !this.isPrivate) {
|
||||
const conversationId = this.currentChat.id;
|
||||
this.$store.dispatch('toggleTyping', {
|
||||
this.$store.dispatch('conversationTypingStatus/toggleTyping', {
|
||||
status,
|
||||
conversationId,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user