diff --git a/src/App.vue b/src/App.vue index cb20685a227..bb58fb0d080 100644 --- a/src/App.vue +++ b/src/App.vue @@ -92,6 +92,7 @@ export default { defaultPageTitle: false, loading: false, isRefreshingCurrentConversation: false, + audio: null, } }, @@ -193,6 +194,10 @@ export default { return } + if (this.atLeastOneLastMessageIdChanged) { + this.getAudio().play() + } + this.setPageTitle(this.getConversationName(this.token), this.atLeastOneLastMessageIdChanged) }, }, @@ -463,6 +468,14 @@ export default { }) document.querySelector('.conversations-search')[0].focus() }, + + getAudio() { + if (this.audio == null) { + this.audio = new Audio(require('./assets/notification_sound.ogg')) + } + + return this.audio + }, }, } diff --git a/src/assets/notification_sound.ogg b/src/assets/notification_sound.ogg new file mode 100644 index 00000000000..618d06f90b2 Binary files /dev/null and b/src/assets/notification_sound.ogg differ diff --git a/webpack.common.js b/webpack.common.js index fa00ce58dc6..4034e2e1d4b 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -84,6 +84,10 @@ module.exports = { test: /\.(png|jpg|gif|svg)$/, loader: 'url-loader', }, + { + test: /\.ogg$/, + loader: 'file-loader', + }, ], }, plugins: [