Skip to content

Commit 8d371bf

Browse files
committed
PWA show number balloons in taskbar
1 parent c4f8d96 commit 8d371bf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

js/tracker.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ var plot_options = {
116116
]
117117
};
118118

119+
//hide PWA taskbar count
120+
navigator.clearAppBadge();
121+
119122
// aprs overlay (not used)
120123
var overlayARPS = new L.tileLayer('http://{s}.tiles.tracker.habhub.org/aprs/tile_{z}_{x}_{y}.png', {
121124
subdomains: 'abc',
@@ -2619,6 +2622,11 @@ function refresh() {
26192622
complete: function(request, textStatus) {
26202623
document.getElementById("timeperiod").disabled = false;
26212624
clearTimeout(periodical);
2625+
if (Object.keys(vehicles).length > 1) {
2626+
navigator.setAppBadge(Object.keys(vehicles).length); //show number of vehicles on PWA taskbar
2627+
} else {
2628+
navigator.clearAppBadge(); //hide
2629+
}
26222630
periodical = setTimeout(refresh, timer_seconds * 1000);
26232631
}
26242632
});
@@ -2991,6 +2999,11 @@ function updateReceiverMarker(receiver) {
29912999

29923000
// init a marker if the receiver doesn't already have one
29933001
if(!receiver.marker) {
3002+
3003+
if (!receiver.description.includes("radiosonde_auto_rx")) {
3004+
//future option to show different icon per software
3005+
}
3006+
29943007
receiverIcon = new L.icon({
29953008
iconUrl: host_url + markers_url + "antenna-green.png",
29963009
iconSize: [26, 34],

0 commit comments

Comments
 (0)