Skip to content

Commit

Permalink
stop the recap autoplay on the last slide
Browse files Browse the repository at this point in the history
and allow revisiting slides without resuming the timer
  • Loading branch information
ornicar committed Dec 16, 2024
1 parent 6b3e762 commit 24c3b48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/recap/src/swiper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ export const makeSwiper =
setTimeout(() => {
const slide = element.querySelector('.swiper-slide-active');
if (slide) {
if (swiper.isEnd) swiper.autoplay?.stop();
onSlideChange(slide as HTMLElement);
if (!swiper.isEnd && swiper.autoplay?.paused) swiper.autoplay?.resume();
if (swiper.autoplay?.paused) swiper.autoplay?.resume();
}
}, 200);
},
Expand Down

0 comments on commit 24c3b48

Please sign in to comment.