Added hardcoded firefox function

Этот коммит содержится в:
nickago
2015-08-17 08:10:49 -07:00
родитель 63005366ad
Коммит fb9e891246
2 изменённых файлов: 4 добавлений и 4 удалений

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

@@ -13,7 +13,7 @@ var assign = require('object-assign');
function getNotificationsStateFromStores() {
var user = UserStore.getCurrentUser();
var soundNeeded = !utils.checkBrowserType('firefox');
var soundNeeded = !utils.isBrowserFirefox();
var sound = (!user.notify_props || user.notify_props.desktop_sound == undefined) ? "true" : user.notify_props.desktop_sound;
var desktop = (!user.notify_props || user.notify_props.desktop == undefined) ? "all" : user.notify_props.desktop;
var email = (!user.notify_props || user.notify_props.email == undefined) ? "true" : user.notify_props.email;

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

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