mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix scene gallery viewer displaying incorrect image
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { useCallback, useMemo } from "react";
|
import React, { useCallback, useMemo } from "react";
|
||||||
import { useLightbox } from "src/hooks/Lightbox/hooks";
|
import { useLightbox } from "src/hooks/Lightbox/hooks";
|
||||||
import { LoadingIndicator } from "src/components/Shared/LoadingIndicator";
|
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 "flexbin/flexbin.css";
|
||||||
import {
|
import {
|
||||||
CriterionModifier,
|
CriterionModifier,
|
||||||
@@ -45,9 +45,9 @@ export const GalleryViewer: React.FC<IProps> = ({ galleryId }) => {
|
|||||||
}, [images]);
|
}, [images]);
|
||||||
|
|
||||||
const showLightbox = useLightbox(lightboxState);
|
const showLightbox = useLightbox(lightboxState);
|
||||||
const showLightboxOnClick = useCallback(
|
const showLightboxOnClick: PhotoClickHandler = useCallback(
|
||||||
(event, { index }) => {
|
(event, { index }) => {
|
||||||
showLightbox(index);
|
showLightbox({ initialIndex: index });
|
||||||
},
|
},
|
||||||
[showLightbox]
|
[showLightbox]
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user