rix1 / 46brew

A friendly coffee brew helper based on the 4:6 brew method
https://46brew.rix1.now.sh
MIT License
6 stars 1 forks source link

Add wake lock to prevent screen from sleeping, if API is available #13

Closed rexxars closed 4 years ago

rexxars commented 4 years ago

It's kind of annoying when you're brewing and the display turns off. This PR adds support for the (experimental) wake lock API to prevent it from sleeping while the brew process is ongoing.

I'm not sure the useBrewTracker hook is the best place to put it, so feel free to point me in the right direction if it isn't!

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/rix1/46brew/3vpdx6sto ✅ Preview: https://46brew-git-fork-rexxars-wake-lock.rix1.now.sh

rix1 commented 4 years ago

Merging this now. Let me know what you think about removing the event handler @rexxars and I can add it later :)

rexxars commented 4 years ago

I honestly wasn't aware that this API existed. It's been a major pain for me as I developed a habit of tapping the screen every 29 seconds 😅

It's still an experimental feature, but it's "intent to ship" and implemented behind experimental features in chrome, so should be available in maybe ~Chrome 84?

I've manually enabled the feature flag in my Chrome for now, and it seems to be working nicely 👍