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] );