Feature: Alert widget user when message is received from agent (#571)

This commit is contained in:
Pranav Raj S
2020-02-29 11:27:02 +05:30
committed by GitHub
parent b05f843790
commit e8cf59c661
5 changed files with 27 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
import Vue from 'vue';
import { sendMessageAPI, getConversationAPI } from 'widget/api/conversation';
import { MESSAGE_TYPE } from 'widget/helpers/constants';
import { playNotificationAudio } from 'shared/helpers/AudioNotificationHelper';
import getUuid from '../../helpers/uuid';
import DateHelper from '../../../shared/helpers/DateHelper';
@@ -93,6 +94,10 @@ export const actions = {
},
addMessage({ commit }, data) {
if (data.message_type === MESSAGE_TYPE.OUTGOING) {
playNotificationAudio();
}
commit('pushMessageToConversation', data);
},
};