diff --git a/scripts/SettingsController.js b/scripts/SettingsController.js index fac65c3..cdb6bed 100644 --- a/scripts/SettingsController.js +++ b/scripts/SettingsController.js @@ -6,8 +6,10 @@ angular.module('flashy.SettingsController', ['ui.router']). }; console.log('checking to see if chrome'); if (!chrome) { + pushSwitch.disabled = true; return; } + console.log('chrome'); console.log('executing things outside of module'); @@ -270,9 +272,21 @@ angular.module('flashy.SettingsController', ['ui.router']). } var enablePushSwitch = $('.js-checkbox'); + var pushSwitch = document.getElementById("notifbox"); pushSwitch.disabled = true; + var ua = navigator.userAgent.toLowerCase(); + var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile"); + + if(!isAndroid) { + // Do something! + // Redirect to Android-site? + pushSwitch.disabled = true; + console.log("not android"); + return; + } + enablePushSwitch.change(function(e) { console.log('checkbox changed'); if (e.target.checked) {