Skip to content

Commit

Permalink
fix(EpisodePicker): make 0 the initial value for season when no value…
Browse files Browse the repository at this point in the history
… provided, remove placeholder
  • Loading branch information
Botsy committed Feb 11, 2025
1 parent 3f60df9 commit 3c2ab92
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const EpisodePicker = ({ className, onSubmit }: Props) => {
const initialEpisode = isNaN(parseInt(pathEpisode)) ? 1 : parseInt(pathEpisode);
return initialEpisode;
});
const handleSeasonChange = (value: number) => setSeason(!isNaN(value) ? value : 1);
const handleSeasonChange = (value: number) => setSeason(!isNaN(value) ? value : 0);

const handleEpisodeChange = (value: number) => setEpisode(!isNaN(value) ? value : 1);

Expand All @@ -36,7 +36,7 @@ export const EpisodePicker = ({ className, onSubmit }: Props) => {
const disabled = React.useMemo(() => season === parseInt(pathSeason) && episode === parseInt(pathEpisode), [pathSeason, pathEpisode, season, episode]);

return <div className={className}>
<NumberInput min={0} label={t('SEASON')} placeholder={t('SPECIAL')} defaultValue={season} onUpdate={handleSeasonChange} showButtons />
<NumberInput min={0} label={t('SEASON')} defaultValue={season} onUpdate={handleSeasonChange} showButtons />
<NumberInput min={1} label={t('EPISODE')} defaultValue={episode} onUpdate={handleEpisodeChange} showButtons />
<Button className={styles['button-container']} onClick={handleSubmit} disabled={disabled}>
<div className={styles['label']}>{t('SIDEBAR_SHOW_STREAMS')}</div>
Expand Down

0 comments on commit 3c2ab92

Please sign in to comment.