do not show the same HTML5 notification again - save the last id shown in browser local storage
Costa Tsaousis (ktsaou) committed
Sep 26, 2016 at 00:19 UTC
9bb71b09e6307206653c726e0226cfa8fdd27e04
1 file changed
+4
-1
web/dashboard.js
+4
-1
@@ -5802,6 +5802,7 @@
5802
}
5803
5804
NETDATA.alarms.last_notification_id = data[0].unique_id;
5805
+ NETDATA.localStorageSet('last_notification_id', NETDATA.alarms.last_notification_id, null);
5806
// console.log('last notification id = ' + NETDATA.alarms.last_notification_id);
5807
})
5808
},
@@ -5898,7 +5899,9 @@
5899
while(host.slice(-1) === '/')
5900
host = host.substring(0, host.length - 1);
5901
NETDATA.alarms.server = host;
5901
-
5902
+
5903
+ NETDATA.alarms.last_notification_id = NETDATA.localStorageGet('last_notification_id', NETDATA.alarms.last_notification_id, null);
5904
+
5905
if(NETDATA.alarms.onclick === null)
5906
NETDATA.alarms.onclick = NETDATA.alarms.scrollToAlarm;
5907