mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
fix: season selector not working
This commit is contained in:
parent
7d7bf312b7
commit
1d4988c4dd
2 changed files with 3 additions and 3 deletions
|
@ -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 a new issue