only keep session alive if page is not hidden

This commit is contained in:
Samuel Lorch 2023-03-11 17:42:27 +01:00
parent f9b3a358dd
commit af292fdb80

View file

@ -63,7 +63,7 @@ onMounted(async() => {
setup(UnauthorizedCallback); setup(UnauthorizedCallback);
await checkAuth(); await checkAuth();
setInterval(function () { setInterval(function () {
if (authState === AuthState.Authenticated) { if (authState === AuthState.Authenticated && !document.hidden) {
checkAuth(); checkAuth();
} }
}.bind(this), 120000); }.bind(this), 120000);