From ec666fb23f876b96ef65847fae69755342ed68aa Mon Sep 17 00:00:00 2001 From: Delirium Date: Wed, 29 May 2024 12:33:56 +0200 Subject: [PATCH] fix ui: fix jump to time func (#2218) --- 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 5d569e386..c25f7b1c3 100644 --- a/frontend/app/components/Session/WebPlayer.tsx +++ b/frontend/app/components/Session/WebPlayer.tsx @@ -84,7 +84,9 @@ function WebPlayer(props: any) { if (jumpToTime || shouldAdjustOffset) { if (jumpToTime > visualOffset) { - contextValue.player.jump(parseInt(String(jumpToTime - startedAt))); + const diff = + startedAt < jumpToTime ? jumpToTime - startedAt : jumpToTime; + contextValue.player.jump(Math.max(diff, 0)); } else { contextValue.player.jump(visualOffset); setAdjusted(true);