Fix issue where screen would eventually turn off if you switched apps and then came back
This commit is contained in:
@@ -109,10 +109,11 @@
|
|||||||
let previousReadingTime = null;
|
let previousReadingTime = null;
|
||||||
|
|
||||||
let screenLock;
|
let screenLock;
|
||||||
navigator.wakeLock.request('screen')
|
document.addEventListener('visibilitychange', async () => {
|
||||||
.then(lock => {
|
if (screenLock !== null && document.visibilityState === 'visible') {
|
||||||
screenLock = lock;
|
screenLock = await navigator.wakeLock.request('screen');
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const integerNumber = (num) => parseInt(num);
|
const integerNumber = (num) => parseInt(num);
|
||||||
const decimalNumber = (num) => parseFloat(num.toFixed(1));
|
const decimalNumber = (num) => parseFloat(num.toFixed(1));
|
||||||
|
|||||||
Reference in New Issue
Block a user