Skip to content

Commit 0fcb4dc

Browse files
authored
Merge pull request #29 from Sak1012/camera
Turn off inactivity for Checkin
2 parents 22149b7 + 89f18ca commit 0fcb4dc

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/components/Utilities/QRCamera.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { onBeforeMount, ref, nextTick, onMounted, onUnmounted } from 'vue'
33
import { QrcodeStream } from 'vue-qrcode-reader'
44
import StandardButton from '@/components/Common/StandardButton.vue'
55
import { useCameraStore } from '@/stores/camera'
6+
import { useEventyayApi } from '@/stores/eventyayapi'
67
import RefreshButton from '@/components/Utilities/RefreshButton.vue'
78
import { ArrowsRightLeftIcon, VideoCameraIcon } from '@heroicons/vue/20/solid'
89
@@ -13,8 +14,11 @@ const destroyed = ref(false)
1314
const isCameraOn = ref(false)
1415
let inactivityTimer = null
1516
17+
const processApi = useEventyayApi()
18+
const { selectedRole } = processApi
19+
1620
onMounted(() => {
17-
startInactivityTimer()
21+
if (selectedRole!="Badge Station") {startInactivityTimer()}
1822
})
1923
2024
onUnmounted(() => {
@@ -106,10 +110,12 @@ function toggleCamera() {
106110
107111
function startInactivityTimer() {
108112
clearInactivityTimer()
109-
inactivityTimer = setTimeout(() => {
110-
isCameraOn.value = false
111-
cameraStore.paused = true
112-
}, 25000) // 25 seconds
113+
if (selectedRole!="Badge Station") {
114+
inactivityTimer = setTimeout(() => {
115+
isCameraOn.value = false
116+
cameraStore.paused = true
117+
}, 25000) // 25 seconds
118+
}
113119
}
114120
115121
function clearInactivityTimer() {

0 commit comments

Comments
 (0)