]> arthur.barton.de Git - netdata.git/commitdiff
allow user to deny notification request
authorLucaDev <l.kroeger01@gmail.com>
Sat, 27 Aug 2016 19:26:44 +0000 (21:26 +0200)
committerLucaDev <l.kroeger01@gmail.com>
Sat, 27 Aug 2016 19:26:44 +0000 (21:26 +0200)
web/dashboard.js

index c3625955f72658fda57419e0bdf582de6b5f89b4..849ea6d392fe2406c82cd3453850bb6f86b530eb 100644 (file)
         update_forever: function() {
             NETDATA.alarms.get('active', function(data) {
                 if(data !== null) {
-                    if("Notification" in window && NETDATA.alarms.current != null) {
+                    if('Notification' in window && NETDATA.alarms.current != null) {
                         if(Object.keys(NETDATA.alarms.current.alarms).length < Object.keys(data.alarms).length) {
                             if (Notification.permission === 'granted') {
                                 new Notification('Netdata Alarm!', {body: 'Your Server needs attention!',
 
         init: function() {
             NETDATA.alarms.update_forever();
-            if ("Notification" in window && Notification.permission !== 'granted') {
+            if ('Notification' in window && Notification.permission === 'default') {
                 Notification.requestPermission();
             }
         }