feat: Update conversation attributes in realtime when they changed (#5542)

Co-authored-by: daniel gannage <daniel@pxdel.com>
Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
This commit is contained in:
DanielGannage
2022-10-19 20:26:10 -04:00
committed by GitHub
parent 10d86fbb35
commit a3277b45af
3 changed files with 29 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ class ActionCableConnector extends BaseActionCableConnector {
'notification.created': this.onNotificationCreated,
'first.reply.created': this.onFirstReplyCreated,
'conversation.read': this.onConversationRead,
'conversation.updated': this.onConversationUpdated,
};
}
@@ -85,6 +86,11 @@ class ActionCableConnector extends BaseActionCableConnector {
this.fetchConversationStats();
};
onConversationUpdated = data => {
this.app.$store.dispatch('updateConversation', data);
this.fetchConversationStats();
};
onTypingOn = ({ conversation, user }) => {
const conversationId = conversation.id;