ui: some tweaks for visual adjust jump

This commit is contained in:
nick-delirium 2025-01-31 17:32:29 +01:00
parent 88c1f18c48
commit 392088be22
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 3 additions and 2 deletions

View file

@ -151,10 +151,11 @@ function WebPlayer(props: any) {
const shouldAdjustOffset = visualOffset !== 0 && !visuallyAdjusted;
if (jumpToTime || shouldAdjustOffset) {
if (jumpToTime > visualOffset) {
if (jumpToTime && jumpToTime > visualOffset) {
const diff =
startedAt < jumpToTime ? jumpToTime - startedAt : jumpToTime;
contextValue.player.jump(Math.max(diff, 0));
setAdjusted(true);
} else {
contextValue.player.jump(visualOffset);
setAdjusted(true);

View file

@ -368,7 +368,7 @@ export const compareJsonObjects = (obj1: any, obj2: any) => {
return JSON.stringify(obj1) === JSON.stringify(obj2);
};
export const getInitials = (name: any) => {
export const getInitials = (name = '') => {
const names = name.split(' ');
return (
names