Skip to content

Commit

Permalink
update version to latest and address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Feb 26, 2024
1 parent 4b02e7a commit 77e422e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"lodash": "4.17.21",
"mixpanel-browser": "2.22.1",
"netmask": "2.0.2",
"react-hook-form": "7.49.3",
"react-hook-form": "7.50.1",
"path-to-regexp": "3.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
25 changes: 12 additions & 13 deletions app/src/organisms/AppSettings/ManualIpHostnameForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ export function ManualIpHostnameForm({
dispatch(startDiscovery())
}

const resolver: Resolver<FormValues> = values => {
let errors = {}
errors = validateForm(values, errors)
return { values, errors }
}
const { formState, handleSubmit, register, reset } = useForm<FormValues>({
defaultValues: {
ip: '',
},
resolver: resolver,
})

const validateForm = (
data: FormValues,
errors: Record<string, FieldError>
Expand All @@ -95,19 +107,6 @@ export function ManualIpHostnameForm({
return updatedErrors
}

const resolver: Resolver<FormValues> = values => {
let errors = {}
errors = validateForm(values, errors)
return { values, errors }
}

const { formState, handleSubmit, register, reset } = useForm<FormValues>({
defaultValues: {
ip: '',
},
resolver: resolver,
})

const onSubmit = (data: FormValues): void => {
const trimmedIp = data.ip.trim()
const inputForm = document.getElementById('ip')
Expand Down
23 changes: 11 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,11 @@
dependencies:
"@hapi/hoek" "^9.0.0"

"@hookform/[email protected]":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-3.1.1.tgz#b374d33e356428fff9c6ef3c933441fe15e40784"
integrity sha512-tS16bAUkqjITNSvbJuO1x7MXbn7Oe8ZziDTJdA9mMvsoYthnOOiznOTGBYwbdlYBgU+tgpI/BtTU3paRbCuSlg==

"@humanwhocodes/config-array@^0.11.13":
version "0.11.14"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b"
Expand All @@ -1744,10 +1749,6 @@
version "2.0.2"
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917"
integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==
"@hookform/[email protected]":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-3.1.1.tgz#b374d33e356428fff9c6ef3c933441fe15e40784"
integrity sha512-tS16bAUkqjITNSvbJuO1x7MXbn7Oe8ZziDTJdA9mMvsoYthnOOiznOTGBYwbdlYBgU+tgpI/BtTU3paRbCuSlg==

"@hutson/parse-repository-url@^3.0.0":
version "3.0.2"
Expand Down Expand Up @@ -2271,7 +2272,7 @@
react "18.2.0"
react-dom "18.2.0"
react-error-boundary "^4.0.10"
react-hook-form "7.49.3"
react-hook-form "7.50.1"
react-i18next "13.5.0"
react-intersection-observer "^8.33.1"
react-redux "8.1.2"
Expand Down Expand Up @@ -15139,13 +15140,6 @@ node-abi@^3.45.0:
dependencies:
semver "^7.3.5"

node-abi@^3.45.0:
version "3.54.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.54.0.tgz#f6386f7548817acac6434c6cba02999c9aebcc69"
integrity sha512-p7eGEiQil0YUV3ItH4/tBb781L5impVmmx2E9FRKF7d18XXzp4PGT2tdYMFY6wQqgxD0IwNZOiSJ0/K0fSi/OA==
dependencies:
semver "^7.3.5"

node-addon-api@^1.6.3:
version "1.7.2"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d"
Expand Down Expand Up @@ -17595,6 +17589,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.49.3.tgz#576a4567f8a774830812f4855e89f5da5830435c"
integrity sha512-foD6r3juidAT1cOZzpmD/gOKt7fRsDhXXZ0y28+Al1CHgX+AY1qIN9VSIIItXRq1dN68QrRwl1ORFlwjBaAqeQ==

[email protected]:
version "7.50.1"
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.50.1.tgz#f6aeb17a863327e5a0252de8b35b4fc8990377ed"
integrity sha512-3PCY82oE0WgeOgUtIr3nYNNtNvqtJ7BZjsbxh6TnYNbXButaD5WpjOmTjdxZfheuHKR68qfeFnEDVYoSSFPMTQ==

[email protected]:
version "13.5.0"
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.5.0.tgz#44198f747628267a115c565f0c736a50a76b1ab0"
Expand Down

0 comments on commit 77e422e

Please sign in to comment.