mirror of
https://github.com/meshtastic/web.git
synced 2026-04-23 23:38:04 -04:00
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";
|
||||
|
||||
export const HTTP = ({ closeDialog }: TabElementProps): JSX.Element => {
|
||||
const [https, setHTTPs] = useState();
|
||||
const [https, setHTTPS] = useState(false);
|
||||
const { addDevice } = useDeviceStore();
|
||||
const { setSelectedDevice } = useAppStore();
|
||||
const { register, handleSubmit, control, watch } = useForm<{
|
||||
@@ -64,21 +64,23 @@ export const HTTP = ({ closeDialog }: TabElementProps): JSX.Element => {
|
||||
<Controller
|
||||
name="tls"
|
||||
control={control}
|
||||
render={({ field: { value, onChange, ...rest } }) => {
|
||||
return (
|
||||
<>
|
||||
<Label>Use HTTPS</Label>
|
||||
<Switch
|
||||
onCheckedChange={(e) => {}}
|
||||
disabled={
|
||||
location.protocol === "https:" || connectionInProgress
|
||||
}
|
||||
checked={!!value}
|
||||
{...rest}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}}
|
||||
render={({ field: { value, ...rest } }) => (
|
||||
<>
|
||||
<Label>Use HTTPS</Label>
|
||||
<Switch
|
||||
onCheckedChange={(checked) => {
|
||||
checked ? setHTTPS(true) : setHTTPS(false);
|
||||
}}
|
||||
// label="Use TLS"
|
||||
// description="Description"
|
||||
disabled={
|
||||
location.protocol === "https:" || connectionInProgress
|
||||
}
|
||||
checked={value}
|
||||
{...rest}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
|
||||
@@ -14,6 +14,11 @@ interface ErrorState {
|
||||
message: string;
|
||||
}
|
||||
|
||||
interface ErrorState {
|
||||
field: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
interface AppState {
|
||||
selectedDevice: number;
|
||||
devices: {
|
||||
|
||||
Reference in New Issue
Block a user