diff --git a/apps/website/src/components/molecules/Toast.svelte b/apps/website/src/components/molecules/Toast.svelte index 9a033fd..c8dbbe8 100644 --- a/apps/website/src/components/molecules/Toast.svelte +++ b/apps/website/src/components/molecules/Toast.svelte @@ -30,10 +30,11 @@ // Image rotation let imagesLoop: ReturnType let currentImageIndex = 0 + const loopDuration = 3000 const incrementCurrentImageIndex = () => { currentImageIndex = currentImageIndex === images.length - 1 ? 0 : currentImageIndex + 1 - imagesLoop = setTimeout(() => requestAnimationFrame(incrementCurrentImageIndex), 3000) + imagesLoop = setTimeout(() => requestAnimationFrame(incrementCurrentImageIndex), loopDuration) } // Close toast @@ -52,7 +53,7 @@ onMount(() => { if (images.length > 1) { - incrementCurrentImageIndex() + imagesLoop = setTimeout(incrementCurrentImageIndex, loopDuration) } return () => {