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

master
Kevin Froman 2020-03-22 22:04:06 -05:00
parent 42a8d71ebf
commit c7b8f9bed6
1 changed files with 4 additions and 0 deletions

View File

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