added logic for stranger notification setting

made page content refreshes happen on visibility
This commit is contained in:
Kevin Froman 2020-04-05 03:52:40 -05:00
parent 7bedae48a4
commit 4cd2302bc9
5 changed files with 25 additions and 4 deletions

View file

@ -34,4 +34,11 @@ function setupInterval(){
var refreshInterval = setInterval(autoRefresh, 3000)
setupInterval()
checkbox.onchange = function(){setupInterval}
checkbox.onchange = function(){setupInterval}
document.addEventListener("visibilitychange", function() {
if (document.visibilityState === 'visible') {
autoRefresh()
}
})

View file

@ -441,4 +441,10 @@ setActiveTab('inbox')
setInterval(function(){mailPing()}, 10000)
mailPing()
window.inboxInterval = setInterval(function(){refreshPms(true)}, 3000)
refreshPms(true)
refreshPms(true)
document.addEventListener("visibilitychange", function() {
if (document.visibilityState === 'visible') {
refreshPms()
}
})

View file

@ -136,5 +136,11 @@ var getStats = function(){
})
}
document.addEventListener("visibilitychange", function() {
if (document.visibilityState === 'visible') {
getStats()
}
})
getStats()
setInterval(function(){getStats()}, 10000)
setInterval(function(){getStats()}, 1000)