From c80d884fd88ab87ccc4bfdb0973d731782c1e05c Mon Sep 17 00:00:00 2001 From: Axel Boberg Date: Sat, 30 Mar 2024 08:33:24 +0100 Subject: [PATCH] Clear the progress if finished or invalid Signed-off-by: Axel Boberg --- plugins/rundown/app/components/RundownItem/index.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/rundown/app/components/RundownItem/index.jsx b/plugins/rundown/app/components/RundownItem/index.jsx index fe366b0..d0f59e5 100644 --- a/plugins/rundown/app/components/RundownItem/index.jsx +++ b/plugins/rundown/app/components/RundownItem/index.jsx @@ -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()