mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
🐛 Fix defaultValue crash
This commit is contained in:
@@ -10,6 +10,9 @@ interface NetworkTabProps {
|
|||||||
|
|
||||||
export const NetworkTab = ({ form }: NetworkTabProps) => {
|
export const NetworkTab = ({ form }: NetworkTabProps) => {
|
||||||
const { t } = useTranslation('layout/modals/add-app');
|
const { t } = useTranslation('layout/modals/add-app');
|
||||||
|
const acceptableStatusCodes = (form.values.network.statusCodes ?? ['200']).map((x) =>
|
||||||
|
x.toString()
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<Tabs.Panel value="network" pt="lg">
|
<Tabs.Panel value="network" pt="lg">
|
||||||
<Switch
|
<Switch
|
||||||
@@ -27,7 +30,7 @@ export const NetworkTab = ({ form }: NetworkTabProps) => {
|
|||||||
data={StatusCodes}
|
data={StatusCodes}
|
||||||
clearable
|
clearable
|
||||||
searchable
|
searchable
|
||||||
defaultValue={form.values.network.okStatus.map((x) => `${x}`)}
|
defaultValue={acceptableStatusCodes}
|
||||||
variant="default"
|
variant="default"
|
||||||
{...form.getInputProps('network.statusCodes')}
|
{...form.getInputProps('network.statusCodes')}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user