diff --git a/scripts/SettingsController.js b/scripts/SettingsController.js index b0b6e97..e4161e3 100644 --- a/scripts/SettingsController.js +++ b/scripts/SettingsController.js @@ -28,7 +28,8 @@ angular.module('flashy.SettingsController', ['ui.router']). } console.log("gonna try to launch service worker now"); - navigator.serviceWorker.register('scripts/service-worker.js').then( + if ('serviceWorker' in navigator) { + navigator.serviceWorker.register('scripts/service-worker.js').then( function(serviceWorkerRegistration) { serviceWorkerRegistration.pushManager.subscribe().then( function(pushSubscription) { @@ -46,4 +47,10 @@ angular.module('flashy.SettingsController', ['ui.router']). } ); }); + + } else { + console.log('Service workers aren\'t supported in this browser.'); + } + + }); diff --git a/templates/settings.html b/templates/settings.html index 59f0ff2..3edca7e 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -1,13 +1,17 @@ <div class="card" id="resetPasswordForm"> - <input type="checkbox" class="js-checkbox" name="notifbox" value="toggle notifs">Check this to enable notifications<br> + <!-- + class="js-checkbox" name="notifbox" value="toggle notifs"> --> + <form action="#"> + <input type="checkbox" id = "notifbox" class="js-checkbox" /> + <label for="notifbox">Check this to enable notifications</label> + </form> <h2>Change Password</h2> <div class="row"> <form class="col s12"> - <div class="row"> <div class="input-field col s12"> <input id="password" type="password" ng-model="oldPassword" class="validate">