From f9fb33e8ccfabd91f82904605c8a571329e0fc1c Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Wed, 9 Apr 2025 12:30:04 +1000 Subject: [PATCH] Fix scene gallery viewer displaying incorrect image --- ui/v2.5/src/components/Galleries/GalleryViewer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/v2.5/src/components/Galleries/GalleryViewer.tsx b/ui/v2.5/src/components/Galleries/GalleryViewer.tsx index 3a860e48b..7ebb679fd 100644 --- a/ui/v2.5/src/components/Galleries/GalleryViewer.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryViewer.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useMemo } from "react"; import { useLightbox } from "src/hooks/Lightbox/hooks"; import { LoadingIndicator } from "src/components/Shared/LoadingIndicator"; -import Gallery from "react-photo-gallery"; +import Gallery, { PhotoClickHandler } from "react-photo-gallery"; import "flexbin/flexbin.css"; import { CriterionModifier, @@ -45,9 +45,9 @@ export const GalleryViewer: React.FC = ({ galleryId }) => { }, [images]); const showLightbox = useLightbox(lightboxState); - const showLightboxOnClick = useCallback( + const showLightboxOnClick: PhotoClickHandler = useCallback( (event, { index }) => { - showLightbox(index); + showLightbox({ initialIndex: index }); }, [showLightbox] );