don't fetch stats on home page if there is no window focus

This commit is contained in:
Kevin Froman 2020-03-22 22:04:06 -05:00
parent 42a8d71ebf
commit c7b8f9bed6

View File

@ -82,6 +82,10 @@ fetch('/config/get/general.security_level', {
}) })
var getStats = function(){ var getStats = function(){
if (document.hidden()){
console.debug('skipping stats since no window focus')
return
}
fetch('/getstats', { fetch('/getstats', {
headers: { headers: {
"token": webpass "token": webpass