A site added two slides to the lobby display and it never changed between them. onMounted awaited fetchSlides, which starts the slideshow itself once it has more than one slide, and then started it AGAIN unconditionally. Two timer chains ran, and the second assignment to slideTimer lost the handle to the first, so nothing could ever cancel it. Both fired about ten seconds later, milliseconds apart, and each advanced one slide. With exactly two slides that is 0 -> 1 -> 0 every cycle: the display looked frozen. With three or more it advanced by two and merely skipped one, which is why this survived so long - and why adding a third slide would have appeared to "fix" it. onMounted no longer starts it; fetchSlides owns that. scheduleNextSlide also cancels any pending timer before setting a new one, so a future double-call replaces the chain rather than leaking an untracked one. While here: the feed has always sent a per-slide duration and the display ignored it, hardcoding ten seconds, so a slide set to hold for a minute changed after ten. It now uses the slide's own value, and the progress bar animates over that same duration instead of finishing early and sitting full.
5.2 KiB
5.2 KiB