From 082a04c30c17c2cef2b79a7a00b85fe9e90c7eab Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 26 Dec 2022 17:39:20 +0800 Subject: [PATCH] Maybe visibilityState is more reliable --- src/app.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.jsx b/src/app.jsx index 2be745a9..c4838d1e 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -107,7 +107,7 @@ async function startStream() { function startVisibility() { const handleVisibilityChange = () => { - if (document.hidden) { + if (document.visibilityState === 'hidden') { const timestamp = Date.now(); store.session.set('lastHidden', timestamp); } else {