feat: End conversation from widget (#3660)

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Aswin Dev P.S 2022-03-15 22:07:30 +05:30 committed by GitHub
parent 4b748e2c8c
commit c4837cd7ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 263 additions and 18 deletions

View file

@ -11,12 +11,16 @@ class ActionCableConnector extends BaseActionCableConnector {
'conversation.typing_on': this.onTypingOn,
'conversation.typing_off': this.onTypingOff,
'conversation.status_changed': this.onStatusChange,
'conversation.created': this.onConversationCreated,
'presence.update': this.onPresenceUpdate,
'contact.merged': this.onContactMerge,
};
}
onStatusChange = data => {
if (data.status === 'resolved') {
this.app.$store.dispatch('campaign/resetCampaign');
}
this.app.$store.dispatch('conversationAttributes/update', data);
};
@ -33,6 +37,10 @@ class ActionCableConnector extends BaseActionCableConnector {
this.app.$store.dispatch('conversation/addOrUpdateMessage', data);
};
onConversationCreated = () => {
this.app.$store.dispatch('conversationAttributes/getAttributes');
};
onPresenceUpdate = data => {
this.app.$store.dispatch('agent/updatePresence', data.users);
};