From 6b7de16afb74c57ec5aaa4320053491fa6b47774 Mon Sep 17 00:00:00 2001 From: jjagielka Date: Fri, 22 Dec 2023 12:55:04 +0100 Subject: [PATCH] fix carousel loop last image (#1191) --- src/lib/carousel/Carousel.svelte | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lib/carousel/Carousel.svelte b/src/lib/carousel/Carousel.svelte index b56a12315..dfce0a6ca 100644 --- a/src/lib/carousel/Carousel.svelte +++ b/src/lib/carousel/Carousel.svelte @@ -53,16 +53,6 @@ dispatch('change', images[index]); }); - let prevIndex: number = index; - $: { - if (!prevIndex || prevIndex < index) { - update((_state) => ({ ..._state, forward: true, index })); - } else { - update((_state) => ({ ..._state, forward: false, index })); - } - prevIndex = index; - } - const nextSlide = () => { update((_state) => { if (!canChangeSlide({ lastSlideChange: _state.lastSlideChange, slideDuration, slideDurationRatio: SLIDE_DURATION_RATIO })) return _state;