1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-24 22:35:49 -04:00

Remove redundant code in selecting with click on poster

(cherry picked from commit b116f63a1d95a23a6f3684e6b60ead60c2584f0f)
This commit is contained in:
Bogdan
2025-08-17 13:24:22 +03:00
committed by bakerboy448
parent 1e72cc6b5a
commit abf3fc4557
4 changed files with 24 additions and 34 deletions
@@ -7,15 +7,23 @@ import styles from './MovieIndexPosterSelect.css';
interface MovieIndexPosterSelectProps {
movieId: number;
titleSlug: string;
}
function MovieIndexPosterSelect(props: MovieIndexPosterSelectProps) {
const { movieId } = props;
function MovieIndexPosterSelect({
movieId,
titleSlug,
}: MovieIndexPosterSelectProps) {
const [selectState, selectDispatch] = useSelect();
const isSelected = selectState.selectedState[movieId];
const onSelectPress = useCallback(
(event: SyntheticEvent<HTMLElement, PointerEvent>) => {
if (event.nativeEvent.ctrlKey || event.nativeEvent.metaKey) {
window.open(`${window.Radarr.urlBase}/movie/${titleSlug}`, '_blank');
return;
}
const shiftKey = event.nativeEvent.shiftKey;
selectDispatch({
@@ -25,7 +33,7 @@ function MovieIndexPosterSelect(props: MovieIndexPosterSelectProps) {
shiftKey,
});
},
[movieId, isSelected, selectDispatch]
[movieId, titleSlug, isSelected, selectDispatch]
);
return (