Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix(activeSession): minor fixes #11125

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/composables/useActiveSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { showInfo } from '@nextcloud/dialogs'

import { SESSION } from '../constants.js'
import { setSessionState } from '../services/participantsService.js'
import { useIsInCall } from './useIsInCall.js'
import { useStore } from './useStore.js'

const supportSessionState = getCapabilities()?.spreed?.features?.includes('session-state')
Expand All @@ -42,6 +43,7 @@ export function useActiveSession() {
}

const store = useStore()
const isInCall = useIsInCall()
const token = computed(() => store.getters.getToken())
const windowIsVisible = computed(() => store.getters.windowIsVisible())

Expand Down Expand Up @@ -94,6 +96,9 @@ export function useActiveSession() {
|| !token.value) {
return
}
if (isInCall.value) {
return
}
clearTimeout(inactiveTimer.value)
inactiveTimer.value = null
currentState.value = SESSION.STATE.INACTIVE
Expand All @@ -111,13 +116,13 @@ export function useActiveSession() {
}

const handleWindowFocus = ({ type }) => {
clearTimeout(inactiveTimer.value)
if (type === 'focus') {
setSessionAsActive()

document.removeEventListener('mouseenter', handleMouseMove)
document.removeEventListener('mouseleave', handleMouseMove)
} else if (type === 'blur') {
clearTimeout(inactiveTimer.value)
inactiveTimer.value = setTimeout(() => {
setSessionAsInactive()
}, INACTIVE_TIME_MS)
Expand Down
Loading