From e3f6ff1fe2eb9b378229b3dd0ddd92c6b3a99e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Delattre?= Date: Thu, 9 Apr 2020 11:02:34 +0200 Subject: [PATCH] Fix empty torrents returned as array in show episodes The show episodes can handle undefined values themselves. --- frontend/js/components/shows/details/torrentsButton.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/js/components/shows/details/torrentsButton.js b/frontend/js/components/shows/details/torrentsButton.js index b739ac1..7e7c40b 100644 --- a/frontend/js/components/shows/details/torrentsButton.js +++ b/frontend/js/components/shows/details/torrentsButton.js @@ -19,10 +19,8 @@ export const EpisodeTorrentsButton = ({ season, episode }) => { ? state.show.show.seasons.get(season).get(episode).fetching : false ); - const torrents = useSelector((state) => - state.show.show.seasons.get(season).get(episode).torrents - ? state.show.show.seasons.get(season).get(episode).torrents - : [] + const torrents = useSelector( + (state) => state.show.show.seasons.get(season).get(episode).torrents ); const url = useSelector(