From 794b5c0ea6dcd9ac85d291c65a8524a75932f286 Mon Sep 17 00:00:00 2001 From: Sped0n Date: Tue, 23 Jan 2024 00:28:05 +0800 Subject: [PATCH] fix: fix indexing issue in `loadImages` function --- assets/ts/mobile/gallery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/ts/mobile/gallery.ts b/assets/ts/mobile/gallery.ts index 86d28ad..d53b4da 100644 --- a/assets/ts/mobile/gallery.ts +++ b/assets/ts/mobile/gallery.ts @@ -287,7 +287,7 @@ function loadImages(): void { // load current, next, prev image activeImages.push(galleryImages[swiper.activeIndex]) activeImages.push( - galleryImages[Math.min(swiper.activeIndex + 1, swiper.slides.length)] + galleryImages[Math.min(swiper.activeIndex + 1, swiper.slides.length - 1)] ) activeImages.push(galleryImages[Math.max(swiper.activeIndex - 1, 0)]) for (const e of activeImages) {