Skip to content

Commit

Permalink
fix onCreate function
Browse files Browse the repository at this point in the history
  • Loading branch information
KatieMSB committed Feb 28, 2025
1 parent 1b566a9 commit 57f2667
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions web/src/app/services/ServiceLabelForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ export default function LabelForm(props: LabelFormProps): React.JSX.Element {
label='Key'
name='key'
required
onCreate={(key) => {
if (!cfg['General.DisableLabelCreation']) {
otherProps.onChange({ ...otherProps.value, key })
}
}}
onCreate={
!cfg['General.DisableLabelCreation']
? (key: string) =>
otherProps.onChange({ ...otherProps.value, key })
: undefined
}
validate={validateKey}
/>
)}
Expand Down

0 comments on commit 57f2667

Please sign in to comment.