diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-10-23 07:14:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-23 07:14:39 +0200 |
commit | 30c4fea1837b707111d4d097f629401a9eeacea0 (patch) | |
tree | 0a08786757a25bfb39664600f4dc003ca8d21188 | |
parent | 38b1ab6f7250aa5ed5940acdb708327f1ef8e974 (diff) | |
parent | 331d498c82a97c8af21d0f3dd68b449dd6ded76f (diff) |
Merge pull request #10714 from nextcloud/fix/10544/adjust-inactive-session
fix(useActiveSession): adjust behavior of inactive session
-rw-r--r-- | src/composables/useActiveSession.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/composables/useActiveSession.js b/src/composables/useActiveSession.js index 6c1c9ce29..b90286345 100644 --- a/src/composables/useActiveSession.js +++ b/src/composables/useActiveSession.js @@ -98,7 +98,10 @@ export function useActiveSession() { try { await setSessionState(token.value, SESSION.STATE.INACTIVE) - showInfo(t('spreed', 'Session has been marked as inactive')) + // Show toast message only when tab is visible on screen + if (windowIsVisible.value) { + showInfo(t('spreed', 'Session has been marked as inactive')) + } console.info('Session has been marked as inactive') } catch (error) { console.error(error) @@ -112,6 +115,7 @@ export function useActiveSession() { document.removeEventListener('mouseenter', handleMouseMove) document.removeEventListener('mouseleave', handleMouseMove) } else if (type === 'blur') { + clearTimeout(inactiveTimer.value) inactiveTimer.value = setTimeout(() => { setSessionAsInactive() }, INACTIVE_TIME_MS) @@ -123,6 +127,7 @@ export function useActiveSession() { } const handleMouseMove = (event) => { + setSessionAsActive() // Restart timer, if mouse moves around the tab clearTimeout(inactiveTimer.value) inactiveTimer.value = setTimeout(() => { |