mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
Merge 81df9ea997 into 01a7583364
This commit is contained in:
commit
32e7a1d3b2
2 changed files with 14 additions and 2 deletions
|
|
@ -243,9 +243,15 @@ const MarkerWall: React.FC<IMarkerWallProps> = ({
|
|||
});
|
||||
}, [markers, erroredImgs, handleError]);
|
||||
|
||||
// Guard against duplicate clicks - react-photo-gallery can dispatch
|
||||
// the onClick handler twice for a single click event
|
||||
const onClick = useCallback(
|
||||
(event, { index }) => {
|
||||
history.push(photos[index].link);
|
||||
const link = photos[index].link;
|
||||
const current = history.location.pathname + history.location.search;
|
||||
if (current !== link) {
|
||||
history.push(link);
|
||||
}
|
||||
},
|
||||
[history, photos]
|
||||
);
|
||||
|
|
|
|||
|
|
@ -258,9 +258,15 @@ const SceneWall: React.FC<ISceneWallProps> = ({
|
|||
});
|
||||
}, [scenes, sceneQueue, erroredImgs, handleError]);
|
||||
|
||||
// Guard against duplicate clicks - react-photo-gallery can dispatch
|
||||
// the onClick handler twice for a single click event
|
||||
const onClick = useCallback(
|
||||
(event, { index }) => {
|
||||
history.push(photos[index].link);
|
||||
const link = photos[index].link;
|
||||
const current = history.location.pathname + history.location.search;
|
||||
if (current !== link) {
|
||||
history.push(link);
|
||||
}
|
||||
},
|
||||
[history, photos]
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue