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);
await checkAuth();
setInterval(function () {
if (authState === AuthState.Authenticated) {
if (authState === AuthState.Authenticated && !document.hidden) {
checkAuth();
}
}.bind(this), 120000);