summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-08-18 07:51:04 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-08-18 07:51:04 -0400
commit5f7be5c1d3c3cf2aec60c90c9ff9e2b1f0f81f1b (patch)
tree18a8fd1d95b9b232a4968291d408bf78eee60d3a /web/react/utils
parentca6f4e9d034e26a9b2e3051903c5276a4bd12be0 (diff)
parentfb9e891246db3b8b69e70697d29be5b36b8c7578 (diff)
downloadchat-5f7be5c1d3c3cf2aec60c90c9ff9e2b1f0f81f1b.tar.gz
chat-5f7be5c1d3c3cf2aec60c90c9ff9e2b1f0f81f1b.tar.bz2
chat-5f7be5c1d3c3cf2aec60c90c9ff9e2b1f0f81f1b.zip
Merge pull request #374 from nickago/MM-1299
MM-1299 Fixes problem of two notification sounds in firefox
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/utils.jsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 7591c138f..2312fe225 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -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;
+}