Skip to content

Commit

Permalink
fix carousel loop last image (#1191)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjagielka authored Dec 22, 2023
1 parent 61823c7 commit 6b7de16
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/lib/carousel/Carousel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

2 comments on commit 6b7de16

@vercel
Copy link

@vercel vercel bot commented on 6b7de16 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 6b7de16 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.