mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
fix(EpisodePicker): typings
This commit is contained in:
parent
fbdfa110b5
commit
f7494d6e97
1 changed files with 5 additions and 3 deletions
|
|
@ -24,9 +24,11 @@ export const EpisodePicker = ({ className, onSubmit }: Props) => {
|
|||
const episodeRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const handleSubmit = React.useCallback(() => {
|
||||
const season = seasonRef.current?.value || 1;
|
||||
const episode = episodeRef.current?.value || 1;
|
||||
if (typeof onSubmit === 'function' && !isNaN(season) && !isNaN(parseInt(episode))) onSubmit(season, episode);
|
||||
const season = parseInt(seasonRef.current?.value || '1');
|
||||
const episode = parseInt(episodeRef.current?.value || '1');
|
||||
if (typeof onSubmit === 'function' && !isNaN(season) && !isNaN(episode)) {
|
||||
onSubmit(season, episode);
|
||||
}
|
||||
}, [onSubmit, seasonRef, episodeRef]);
|
||||
|
||||
return <div className={className}>
|
||||
|
|
|
|||
Loading…
Reference in a new issue