Chatwoot/app/javascript/widget/helpers/actionCable.js
Pranav Raj S 3d3aefb197 [Enhancement] Use JS-Cookie to set Cookies (#193)
* Update js-cookie

* Add sdk css

* Remove conversation padding
2019-10-30 10:43:11 +05:30

17 lines
476 B
JavaScript

import BaseActionCableConnector from '../../shared/helpers/BaseActionCableConnector';
class ActionCableConnector extends BaseActionCableConnector {
constructor(app, pubsubToken) {
super(app, pubsubToken);
this.events = {
'message.created': this.onMessageCreated,
};
console.log('joined', app, pubsubToken);
}
onMessageCreated = data => {
this.app.$store.dispatch('conversation/addMessage', data);
};
}
export default ActionCableConnector;