Hotfix - code hanging

This commit is contained in:
Djeex
2025-08-26 20:47:51 +02:00
parent c825798b13
commit d3af86be8c

View File

@ -32,6 +32,7 @@ const randomizeHeroBackground = () => {
if (images.length === 0) return; if (images.length === 0) return;
let currentIndex = Math.floor(Math.random() * images.length); let currentIndex = Math.floor(Math.random() * images.length);
heroBg.style.backgroundImage = `url(/img/${images[currentIndex]})`; heroBg.style.backgroundImage = `url(/img/${images[currentIndex]})`;
if (images.length < 2) return; // <-- Prevent interval if only one image
setInterval(() => { setInterval(() => {
let nextIndex; let nextIndex;
do { do {