1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-24 22:36:19 -04:00

Remove redundant code in selecting with click on poster

This commit is contained in:
Bogdan
2025-08-17 13:24:22 +03:00
committed by Mark McDowall
parent 8e169561f2
commit 858c690543
4 changed files with 22 additions and 33 deletions
@@ -3,8 +3,8 @@
top: 0;
left: 0;
z-index: 3;
width: 36px;
height: 36px;
width: 100%;
height: 100%;
}
.checkContainer {
@@ -7,15 +7,23 @@ import styles from './SeriesIndexPosterSelect.css';
interface SeriesIndexPosterSelectProps {
seriesId: number;
titleSlug: string;
}
function SeriesIndexPosterSelect(props: SeriesIndexPosterSelectProps) {
const { seriesId } = props;
function SeriesIndexPosterSelect({
seriesId,
titleSlug,
}: SeriesIndexPosterSelectProps) {
const [selectState, selectDispatch] = useSelect();
const isSelected = selectState.selectedState[seriesId];
const onSelectPress = useCallback(
(event: SyntheticEvent<HTMLElement, PointerEvent>) => {
if (event.nativeEvent.ctrlKey || event.nativeEvent.metaKey) {
window.open(`${window.Sonarr.urlBase}/series/${titleSlug}`, '_blank');
return;
}
const shiftKey = event.nativeEvent.shiftKey;
selectDispatch({
@@ -25,7 +33,7 @@ function SeriesIndexPosterSelect(props: SeriesIndexPosterSelectProps) {
shiftKey,
});
},
[seriesId, isSelected, selectDispatch]
[seriesId, titleSlug, isSelected, selectDispatch]
);
return (