diff --git a/app/javascript/dashboard/helper/actionCable.js b/app/javascript/dashboard/helper/actionCable.js index 1fb9961dc..9bed8e7d5 100644 --- a/app/javascript/dashboard/helper/actionCable.js +++ b/app/javascript/dashboard/helper/actionCable.js @@ -1,5 +1,6 @@ import AuthAPI from '../api/auth'; import BaseActionCableConnector from '../../shared/helpers/BaseActionCableConnector'; +import { newMessageNotification } from 'shared/helpers/AudioNotificationHelper'; class ActionCableConnector extends BaseActionCableConnector { constructor(app, pubsubToken) { @@ -63,6 +64,7 @@ class ActionCableConnector extends BaseActionCableConnector { onLogout = () => AuthAPI.logout(); onMessageCreated = data => { + newMessageNotification(data); this.app.$store.dispatch('addMessage', data); }; diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index 6b42cf3f2..fd915fb0c 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -22,6 +22,11 @@ "TITLE": "Access Token", "NOTE": "This token can be used if you are building an API based integration" }, + "AUDIO_NOTIFICATIONS_SECTION": { + "TITLE": "Audio Notifications", + "NOTE": "Enable audio notifications in dashboard for new messages and conversations.", + "ENABLE_AUDIO": "Play audio notification when a new conversation is created or new messages arrives" + }, "EMAIL_NOTIFICATIONS_SECTION": { "TITLE": "Email Notifications", "NOTE": "Update your email notification preferences here", diff --git a/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationSettings.vue b/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationSettings.vue index a2d6bf215..38bf2744e 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationSettings.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationSettings.vue @@ -1,5 +1,33 @@