Merge pull request #374 from nickago/MM-1299

MM-1299 Fixes problem of two notification sounds in firefox
Этот коммит содержится в:
Joram Wilander
2015-08-18 07:51:04 -04:00
родитель ca6f4e9d03 fb9e891246
Коммит 5f7be5c1d3
3 изменённых файлов: 30 добавлений и 9 удалений

Просмотреть файл

@@ -124,8 +124,10 @@ module.exports.notifyMe = function(title, body, channel) {
}
module.exports.ding = function() {
var audio = new Audio('/static/images/ding.mp3');
audio.play();
if (!module.exports.isBrowserFirefox()) {
var audio = new Audio('/static/images/ding.mp3');
audio.play();
}
}
module.exports.getUrlParameter = function(sParam) {
@@ -945,3 +947,7 @@ module.exports.generateId = function() {
return id;
};
module.exports.isBrowserFirefox = function() {
return navigator && navigator.userAgent && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
}