Skip to content

Commit 6b7de16

Browse files
authored
fix carousel loop last image (#1191)
1 parent 61823c7 commit 6b7de16

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/lib/carousel/Carousel.svelte

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@
5353
dispatch('change', images[index]);
5454
});
5555
56-
let prevIndex: number = index;
57-
$: {
58-
if (!prevIndex || prevIndex < index) {
59-
update((_state) => ({ ..._state, forward: true, index }));
60-
} else {
61-
update((_state) => ({ ..._state, forward: false, index }));
62-
}
63-
prevIndex = index;
64-
}
65-
6656
const nextSlide = () => {
6757
update((_state) => {
6858
if (!canChangeSlide({ lastSlideChange: _state.lastSlideChange, slideDuration, slideDurationRatio: SLIDE_DURATION_RATIO })) return _state;

0 commit comments

Comments
 (0)