Split conversation module into getters and actions

This commit is contained in:
Pranav Raj Sreepuram
2019-09-05 13:01:36 +05:30
parent f9d4c2af90
commit 3549fc5fdd
5 changed files with 423 additions and 441 deletions
-5
View File
@@ -4,8 +4,6 @@ import Pusher from 'pusher-js';
import AuthAPI from '../api/auth';
import CONSTANTS from '../constants';
const ding = require('../assets/audio/ding.mp3');
class VuePusher {
constructor(apiKey, options) {
this.app = options.app;
@@ -27,9 +25,6 @@ class VuePusher {
bindEvent(channel) {
channel.bind('message.created', data => {
if (!data.message_type) {
new Audio(ding).play();
}
this.app.$store.dispatch('addMessage', data);
});