@cryptotaxi247 / netdata-1 / commits / 7dfe8e05a

allow user to deny notification request

LucaDev committed Aug 27, 2016 at 21:26 UTC 7dfe8e05adfd791d4b31396801e017b9cb57376e
1 file changed +2 -2
web/dashboard.js
+2 -2
@@ -5601,7 +5601,7 @@
5601 update_forever: function() {
5602 NETDATA.alarms.get('active', function(data) {
5603 if(data !== null) {
5604 - if("Notification" in window && NETDATA.alarms.current != null) {
5604 + if('Notification' in window && NETDATA.alarms.current != null) {
5605 if(Object.keys(NETDATA.alarms.current.alarms).length < Object.keys(data.alarms).length) {
5606 if (Notification.permission === 'granted') {
5607 new Notification('Netdata Alarm!', {body: 'Your Server needs attention!',
@@ -5642,7 +5642,7 @@
5642
5643 init: function() {
5644 NETDATA.alarms.update_forever();
5645 - if ("Notification" in window && Notification.permission !== 'granted') {
5645 + if ('Notification' in window && Notification.permission === 'default') {
5646 Notification.requestPermission();
5647 }
5648 }