fix ui: jumpto param fix (#2222)

This commit is contained in:
Delirium 2024-05-29 17:55:48 +02:00 committed by GitHub
parent fc995408a6
commit 0edc130db0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View file

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

View file

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