If countdown falls under 0 seconds (due to delays) show a countdown of 0 seconds.

This commit is contained in:
Christoph Stahl 2024-11-09 23:00:42 +01:00
parent 4a58b55b88
commit 2dff2d047c

View file

@ -16,6 +16,9 @@ const eta = computed(() =>{
let startTime = new Date(props.firstStartedAt * 1000) let startTime = new Date(props.firstStartedAt * 1000)
let playBackSeconds = (now - startTime) / 1000 let playBackSeconds = (now - startTime) / 1000
let etaSeconds = Math.round(props.offset - playBackSeconds) let etaSeconds = Math.round(props.offset - playBackSeconds)
if etaSeconds < 0 {
etaSeconds = 0
}
if (isNaN(etaSeconds)) { if (isNaN(etaSeconds)) {
return null return null