Skip to content

Commit

Permalink
Fix channel creation
Browse files Browse the repository at this point in the history
  • Loading branch information
markdavella committed May 29, 2024
1 parent 590de16 commit 4d2bd5c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions web/src/components/channel_config/ChannelPropertiesEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Controller, useFormContext } from 'react-hook-form';
import useStore from '../../store/index.ts';
import TunarrLogo from '../TunarrLogo.tsx';
import { ImageUploadInput } from '../settings/ImageUploadInput.tsx';
import { NumericFormControllerText } from '../util/TypedController.tsx';
import ChannelEditActions from './ChannelEditActions.tsx';

const DefaultIconPath = '';
Expand Down Expand Up @@ -56,20 +57,20 @@ export default function ChannelPropertiesEditor({ isNew }: Props) {
<Snackbar />
{channel && (
<>
<Controller
<NumericFormControllerText
name="number"
control={control}
rules={{ required: true }}
render={({ field, formState: { errors } }) => (
<TextField
fullWidth
label="Channel Number"
margin="normal"
helperText={errors.number ? 'Channel number is required' : null}
{...field}
/>
)}
TextFieldProps={{
fullWidth: true,
label: 'Channel Number',
type: 'number',
margin: 'normal',
helperText: ({ formState: { errors } }) =>
errors.number ? 'Channel number is required' : null,
}}
/>

<Controller
name="name"
control={control}
Expand Down

0 comments on commit 4d2bd5c

Please sign in to comment.