From 9f4ac12f93e2f22265fe06b4c5e05be851a7fe5d Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Fri, 31 Mar 2023 17:27:43 +0200 Subject: [PATCH] fix(player): fix initial visual offset jump check --- frontend/app/components/Session/WebPlayer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/app/components/Session/WebPlayer.tsx b/frontend/app/components/Session/WebPlayer.tsx index af0b51b41..98dfd3f72 100644 --- a/frontend/app/components/Session/WebPlayer.tsx +++ b/frontend/app/components/Session/WebPlayer.tsx @@ -31,6 +31,7 @@ function WebPlayer(props: any) { const [activeTab, setActiveTab] = useState(''); const [showNoteModal, setShowNote] = useState(false); const [noteItem, setNoteItem] = useState(undefined); + const [visuallyAdjusted, setAdjusted] = useState(false); // @ts-ignore const [contextValue, setContextValue] = useState(defaultContextValue); @@ -84,8 +85,9 @@ function WebPlayer(props: any) { if (activeTab === '' && !showNoteModal && isPlayerReady && contextValue.player) { contextValue.player.play() - if (visualOffset !== 0) { + if (visualOffset !== 0 && !visuallyAdjusted) { contextValue.player.jump(visualOffset) + setAdjusted(true) } } }, [activeTab, isPlayerReady, showNoteModal, visualOffset])