Skip to content

Commit

Permalink
Clear the progress if finished or invalid
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Boberg <[email protected]>
  • Loading branch information
axelboberg committed Mar 30, 2024
1 parent 26af459 commit c80d884
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/rundown/app/components/RundownItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ export function RundownItem ({ index, item }) {
break
}

if (Number.isNaN(progress)) {
if (Number.isNaN(progress) || (progress >= 1 && item?.state === 'playing')) {
setProgress(0)
return
}

setProgress(Math.max(Math.min(progress, 1), 0))

if (progress >= 1 && item?.state === 'playing') {
return
}
window.requestAnimationFrame(loop)
}
loop()
Expand Down

0 comments on commit c80d884

Please sign in to comment.