mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-24 18:41:48 +01:00
fix: season selector not working
This commit is contained in:
parent
7d7bf312b7
commit
1d4988c4dd
@ -28,7 +28,7 @@ export function EpisodeSelector({ setSelectedSeason, selectedSeason, setEpisode,
|
||||
|
||||
return (
|
||||
<div className="episodeSelector">
|
||||
<TypeSelector setType={setSelectedSeason} choices={seasons.map(v=>({ value: v.toString(), label: `Season ${v}`}))} selected={selectedSeason}/><br></br>
|
||||
<TypeSelector setType={setSelectedSeason} selected={selectedSeason} choices={seasons.map(v=>({ value: v.toString(), label: `Season ${v}`}))} /><br></br>
|
||||
<NumberSelector setType={(e) => setEpisode({episode: e, season: selectedSeason})} choices={choices} selected={(selectedSeason.toString() === currentSeason) ? currentEpisode : null} />
|
||||
</div>
|
||||
)
|
||||
|
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user