From bdfca5b82e20a77880ff56d364668163455b4780 Mon Sep 17 00:00:00 2001 From: G Date: Wed, 29 May 2024 04:46:02 +0800 Subject: [PATCH] fix carousel error --- frontend/src/Components/ViewPage/ViewPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Components/ViewPage/ViewPage.tsx b/frontend/src/Components/ViewPage/ViewPage.tsx index 8e2f587..d88c538 100644 --- a/frontend/src/Components/ViewPage/ViewPage.tsx +++ b/frontend/src/Components/ViewPage/ViewPage.tsx @@ -743,7 +743,7 @@ const Carousel = (props: any) => { }; }, [swiperRef.current]) - const slide = useMemo(() => makeSlides(props.photos.slice(Math.max(0, props.index - RANGE), Math.min(props.index + RANGE, props.photos.length)), swiperRef, props.goBack, props.mouseLeft, props.mouseCenter, props.mouseRight, zoomedRef), [props.photos, props.open, key]); + const slide = useMemo(() => makeSlides(props.photos.slice(Math.max(0, props.index - RANGE), Math.min(props.index + RANGE, props.photos.length)), swiperRef, props.goBack, props.mouseLeft, props.mouseCenter, props.mouseRight, zoomedRef), [props.photos, key]); useEffect(() => { setIndex(props.index);