From 61210506d4aa8531866b0f33f9985c97a2ad8782 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Wed, 8 Feb 2023 16:53:20 +0100 Subject: [PATCH] change(ui): prevent autoplay for in session click map --- frontend/app/components/Session/LivePlayer.tsx | 8 -------- frontend/app/components/Session/WebPlayer.tsx | 4 +++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/app/components/Session/LivePlayer.tsx b/frontend/app/components/Session/LivePlayer.tsx index cf163d452..029fb4274 100644 --- a/frontend/app/components/Session/LivePlayer.tsx +++ b/frontend/app/components/Session/LivePlayer.tsx @@ -75,12 +75,6 @@ function LivePlayer({ } }, []); - const TABS = { - EVENTS: 'User Steps', - CLICKMAP: 'Click Map', - }; - const [activeTab, setActiveTab] = useState(''); - if (!contextValue.player) return null; return ( @@ -89,8 +83,6 @@ function LivePlayer({ )} diff --git a/frontend/app/components/Session/WebPlayer.tsx b/frontend/app/components/Session/WebPlayer.tsx index 81be8b729..298fb1b77 100644 --- a/frontend/app/components/Session/WebPlayer.tsx +++ b/frontend/app/components/Session/WebPlayer.tsx @@ -69,7 +69,9 @@ function WebPlayer(props: any) { const isPlayerReady = contextValue.store?.get().ready React.useEffect(() => { - contextValue.player && contextValue.player.play() + if (activeTab !== 'Click Map') { + contextValue.player && contextValue.player.play() + } }, [insights, isPlayerReady, jumpTimestamp]) // LAYOUT (TODO: local layout state - useContext or something..)