Files
MealQuest/web/src/dinners/keepScreenOn.ts
T
2026-10-09 07:42:48 -04:00

11 lines
401 B
TypeScript

import { useState } from 'react'
// useKeepScreenOn is Kitchen reading mode's Keep screen on switch: whether it
// is on, and a setter. It starts off on each visit.
//
// TODO(c7da10dc): hold a Screen Wake Lock while it is on. Today it is only
// the switch's state; nothing keeps the screen awake yet.
export function useKeepScreenOn(): [boolean, (on: boolean) => void] {
return useState(false)
}