From 1d4988c4dd32c2febf4931de84acdc5272825c05 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Fri, 6 Aug 2021 20:03:18 +0100 Subject: [PATCH] fix: season selector not working --- src/components/EpisodeSelector.js | 2 +- src/views/Movie.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/EpisodeSelector.js b/src/components/EpisodeSelector.js index f0fb16fe..a478873d 100644 --- a/src/components/EpisodeSelector.js +++ b/src/components/EpisodeSelector.js @@ -28,7 +28,7 @@ export function EpisodeSelector({ setSelectedSeason, selectedSeason, setEpisode, return (
- ({ value: v.toString(), label: `Season ${v}`}))} selected={selectedSeason}/>

+ ({ value: v.toString(), label: `Season ${v}`}))} />

setEpisode({episode: e, season: selectedSeason})} choices={choices} selected={(selectedSeason.toString() === currentSeason) ? currentEpisode : null} />
) diff --git a/src/views/Movie.js b/src/views/Movie.js index 936ed8ad..e7aadafc 100644 --- a/src/views/Movie.js +++ b/src/views/Movie.js @@ -35,7 +35,8 @@ export function MovieView(props) { React.useEffect(() => { if (streamData.type === "show" && showRouteMatch) setSelectedSeason(showRouteMatch.params.season.toString()); - }, [showRouteMatch, streamData]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); React.useEffect(() => { let cancel = false; @@ -83,7 +84,6 @@ export function MovieView(props) { React.useEffect(() => { if (streamData.type === "show") { setSeasonList(streamData.seasons); - setSelectedSeason(selectedSeason) setEpisodeList(streamData.episodes[selectedSeason]); } }, [streamData, selectedSeason])