fix: validate bluetooth pin is 6 characters.
This commit is contained in:
@@ -12,7 +12,7 @@ import { useState } from "react";
|
|||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
|
|
||||||
export const HTTP = ({ closeDialog }: TabElementProps): JSX.Element => {
|
export const HTTP = ({ closeDialog }: TabElementProps): JSX.Element => {
|
||||||
const [https, setHTTPs] = useState();
|
const [https, setHTTPS] = useState(false);
|
||||||
const { addDevice } = useDeviceStore();
|
const { addDevice } = useDeviceStore();
|
||||||
const { setSelectedDevice } = useAppStore();
|
const { setSelectedDevice } = useAppStore();
|
||||||
const { register, handleSubmit, control, watch } = useForm<{
|
const { register, handleSubmit, control, watch } = useForm<{
|
||||||
@@ -64,21 +64,23 @@ export const HTTP = ({ closeDialog }: TabElementProps): JSX.Element => {
|
|||||||
<Controller
|
<Controller
|
||||||
name="tls"
|
name="tls"
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field: { value, onChange, ...rest } }) => {
|
render={({ field: { value, ...rest } }) => (
|
||||||
return (
|
<>
|
||||||
<>
|
<Label>Use HTTPS</Label>
|
||||||
<Label>Use HTTPS</Label>
|
<Switch
|
||||||
<Switch
|
onCheckedChange={(checked) => {
|
||||||
onCheckedChange={(e) => {}}
|
checked ? setHTTPS(true) : setHTTPS(false);
|
||||||
disabled={
|
}}
|
||||||
location.protocol === "https:" || connectionInProgress
|
// label="Use TLS"
|
||||||
}
|
// description="Description"
|
||||||
checked={!!value}
|
disabled={
|
||||||
{...rest}
|
location.protocol === "https:" || connectionInProgress
|
||||||
/>
|
}
|
||||||
</>
|
checked={value}
|
||||||
);
|
{...rest}
|
||||||
}}
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ interface ErrorState {
|
|||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ErrorState {
|
||||||
|
field: string;
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface AppState {
|
interface AppState {
|
||||||
selectedDevice: number;
|
selectedDevice: number;
|
||||||
devices: {
|
devices: {
|
||||||
|
|||||||
Reference in New Issue
Block a user