15 lines
354 B
TypeScript
Raw Permalink Normal View History

2026-05-31 13:21:13 +02:00
import { useWakeLock as useVueUseWakeLock } from '@vueuse/core'
import { watch } from 'vue'
import { wakeLockEnabled } from '../state'
export function useWakeLock() {
const { request, release } = useVueUseWakeLock()
watch(wakeLockEnabled, (enabled) => {
if (enabled)
request('screen')
else
release()
}, { immediate: true })
}