diff --git a/frontend/app/components/Session/WebPlayer.tsx b/frontend/app/components/Session/WebPlayer.tsx index 874f15bd5..c2289a52d 100644 --- a/frontend/app/components/Session/WebPlayer.tsx +++ b/frontend/app/components/Session/WebPlayer.tsx @@ -57,18 +57,17 @@ function WebPlayer(props: any) { const [fullView, setFullView] = useState(false); React.useEffect(() => { - if (windowActive) { - const handleActivation = () => { - if (!document.hidden) { - setWindowActive(true); - document.removeEventListener('visibilitychange', handleActivation); - } - }; - document.addEventListener('visibilitychange', handleActivation); - } + const handleActivation = () => { + if (!document.hidden) { + setWindowActive(true); + document.removeEventListener('visibilitychange', handleActivation); + } + }; + document.addEventListener('visibilitychange', handleActivation); return () => { devTools.update('network', { activeTab: 'ALL' }); + document.removeEventListener('visibilitychange', handleActivation); } }, []);