Skip to content

Commit

Permalink
Merge pull request #8108 from gth001/master
Browse files Browse the repository at this point in the history
This fixes the issue of a "stale" CGM value displaying indefinately.
  • Loading branch information
bewest authored Nov 29, 2024
2 parents 085590b + 476bad9 commit 46069a9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions views/clockviews/clock.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@
window.addEventListener('click', function() {
showClose();
});

// This fixes the issue of a "stale" CGM value displaying indefinately.
// It displays "Internet offline." until internet is restored.
function uOffline() {
document.body.innerHTML =
'Internet offline.'
}
// Return to normal as soon as internet connectivity is restored.
function uOnline() {
location.reload()
}
if(window.addEventListener) {
window.addEventListener('offline', uOffline);
window.addEventListener('online', uOnline);
} else {
document.body.attachEvent('onoffline', uOffline);
document.body.attachEvent('ononline', uOnline);
}

<% } %>
</script>
<%if (face == 'config') { %>
Expand Down

0 comments on commit 46069a9

Please sign in to comment.