mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 15:51:14 +00:00
fix: handle case where images array is undefined in Gallery component
This commit is contained in:
@@ -2074,7 +2074,7 @@ function Gallery({ images, nsfw }: { images: number[], nsfw: number[] }) {
|
|||||||
|
|
||||||
// 预加载下一张图片
|
// 预加载下一张图片
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (images.length <= 1) return;
|
if (!images || images.length <= 1) return;
|
||||||
|
|
||||||
const nextIndex = (currentIndex + 1) % images.length;
|
const nextIndex = (currentIndex + 1) % images.length;
|
||||||
const nextImageUrl = network.getImageUrl(images[nextIndex]);
|
const nextImageUrl = network.getImageUrl(images[nextIndex]);
|
||||||
|
|||||||
Reference in New Issue
Block a user