From 0edc130db019a030351c1e1010ba4b646f3af444 Mon Sep 17 00:00:00 2001 From: Delirium Date: Wed, 29 May 2024 17:55:48 +0200 Subject: [PATCH] fix ui: jumpto param fix (#2222) --- frontend/app/components/Session/MobilePlayer.tsx | 3 +-- frontend/app/components/Session/WebPlayer.tsx | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/Session/MobilePlayer.tsx b/frontend/app/components/Session/MobilePlayer.tsx index 6915af74e..c19c6754f 100644 --- a/frontend/app/components/Session/MobilePlayer.tsx +++ b/frontend/app/components/Session/MobilePlayer.tsx @@ -71,11 +71,10 @@ function MobilePlayer(props: any) { if (activeTab === '' && !noteItem !== undefined && messagesProcessed && contextValue.player) { const jumpToTime = props.query.get('jumpto'); + contextValue.player.play(); if (jumpToTime) { contextValue.player.jump(parseInt(jumpToTime)); } - - contextValue.player.play(); } }, [activeTab, noteItem, messagesProcessed]); diff --git a/frontend/app/components/Session/WebPlayer.tsx b/frontend/app/components/Session/WebPlayer.tsx index c25f7b1c3..ffbf3a8ea 100644 --- a/frontend/app/components/Session/WebPlayer.tsx +++ b/frontend/app/components/Session/WebPlayer.tsx @@ -78,10 +78,12 @@ function WebPlayer(props: any) { contextValue.player.pause(); } - if (activeTab === '' && !noteItem !== undefined && messagesProcessed && contextValue.player) { + if (activeTab === '' && messagesProcessed && contextValue.player) { const jumpToTime = props.query.get('jumpto'); const shouldAdjustOffset = visualOffset !== 0 && !visuallyAdjusted; + if (noteItem === undefined) contextValue.player.play(); + if (jumpToTime || shouldAdjustOffset) { if (jumpToTime > visualOffset) { const diff = @@ -92,8 +94,6 @@ function WebPlayer(props: any) { setAdjusted(true); } } - - contextValue.player.play(); } }, [activeTab, noteItem, visualOffset, messagesProcessed]);