fix ui: fix jump to time func (#2218)

This commit is contained in:
Delirium 2024-05-29 12:33:56 +02:00 committed by GitHub
parent 15442db2a8
commit ec666fb23f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);