mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-25 07:01: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 (
|
return (
|
||||||
<div className="episodeSelector">
|
<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} />
|
<NumberSelector setType={(e) => setEpisode({episode: e, season: selectedSeason})} choices={choices} selected={(selectedSeason.toString() === currentSeason) ? currentEpisode : null} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -35,7 +35,8 @@ export function MovieView(props) {
|
|||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (streamData.type === "show" && showRouteMatch) setSelectedSeason(showRouteMatch.params.season.toString());
|
if (streamData.type === "show" && showRouteMatch) setSelectedSeason(showRouteMatch.params.season.toString());
|
||||||
}, [showRouteMatch, streamData]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
let cancel = false;
|
let cancel = false;
|
||||||
@ -83,7 +84,6 @@ export function MovieView(props) {
|
|||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (streamData.type === "show") {
|
if (streamData.type === "show") {
|
||||||
setSeasonList(streamData.seasons);
|
setSeasonList(streamData.seasons);
|
||||||
setSelectedSeason(selectedSeason)
|
|
||||||
setEpisodeList(streamData.episodes[selectedSeason]);
|
setEpisodeList(streamData.episodes[selectedSeason]);
|
||||||
}
|
}
|
||||||
}, [streamData, selectedSeason])
|
}, [streamData, selectedSeason])
|
||||||
|
Loading…
Reference in New Issue
Block a user