Bugfix: Update conversation counters in realtime (#944)
* Bug: Update conversation counters in realtime
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import AuthAPI from '../api/auth';
|
||||
import BaseActionCableConnector from '../../shared/helpers/BaseActionCableConnector';
|
||||
/* global bus */
|
||||
|
||||
class ActionCableConnector extends BaseActionCableConnector {
|
||||
constructor(app, pubsubToken) {
|
||||
@@ -45,10 +46,12 @@ class ActionCableConnector extends BaseActionCableConnector {
|
||||
if (id) {
|
||||
this.app.$store.dispatch('updateAssignee', { id, assignee });
|
||||
}
|
||||
this.fetchConversationStats();
|
||||
};
|
||||
|
||||
onConversationCreated = data => {
|
||||
this.app.$store.dispatch('addConversation', data);
|
||||
this.fetchConversationStats();
|
||||
};
|
||||
|
||||
onLogout = () => AuthAPI.logout();
|
||||
@@ -61,6 +64,7 @@ class ActionCableConnector extends BaseActionCableConnector {
|
||||
|
||||
onStatusChange = data => {
|
||||
this.app.$store.dispatch('updateConversation', data);
|
||||
this.fetchConversationStats();
|
||||
};
|
||||
|
||||
onTypingOn = ({ conversation, user }) => {
|
||||
@@ -100,6 +104,10 @@ class ActionCableConnector extends BaseActionCableConnector {
|
||||
this.onTypingOff({ conversation, user });
|
||||
}, 30000);
|
||||
};
|
||||
|
||||
fetchConversationStats = () => {
|
||||
bus.$emit('fetch_conversation_stats');
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user