chore: fixes from deno linting/formatting

This commit is contained in:
Dan Ditomaso
2025-03-02 14:46:02 -05:00
parent db08542b39
commit 50eb2a827f
136 changed files with 1018 additions and 1082 deletions
+11 -12
View File
@@ -1,4 +1,4 @@
import type { TabElementProps } from "@app/components/Dialog/NewDeviceDialog";
import type { TabElementProps } from "@app/components/Dialog/NewDeviceDialog.tsx";
import { Button } from "@components/UI/Button.tsx";
import { Input } from "@components/UI/Input.tsx";
import { Label } from "@components/UI/Label.tsx";
@@ -9,23 +9,23 @@ import { subscribeAll } from "@core/subscriptions.ts";
import { randId } from "@core/utils/randId.ts";
import { MeshDevice } from "@meshtastic/core";
import { TransportHTTP } from "@meshtastic/transport-http";
import { type JSX, useState } from "react";
import { useState } from "react";
import { Controller, useForm } from "react-hook-form";
export const HTTP = ({ closeDialog }: TabElementProps): JSX.Element => {
export const HTTP = ({ closeDialog }: TabElementProps) => {
const [https, setHTTPS] = useState(false);
const { addDevice } = useDeviceStore();
const { setSelectedDevice } = useAppStore();
const { register, handleSubmit, control, watch } = useForm<{
const { register, handleSubmit, control } = useForm<{
ip: string;
tls: boolean;
}>({
defaultValues: {
ip: ["client.meshtastic.org", "localhost"].includes(
window.location.hostname,
)
globalThis.location.hostname,
)
? "meshtastic.local"
: window.location.host,
: globalThis.location.host,
tls: location.protocol === "https:",
},
});
@@ -61,16 +61,15 @@ export const HTTP = ({ closeDialog }: TabElementProps): JSX.Element => {
<Controller
name="tls"
control={control}
render={({ field: { value, onChange, ...rest } }) => (
render={({ field: { ...rest } }) => (
<>
<Label>Use HTTPS</Label>
<Switch
onCheckedChange={(checked) => {
onCheckedChange={(checked: boolean) => {
checked ? setHTTPS(true) : setHTTPS(false);
}}
disabled={
location.protocol === "https:" || connectionInProgress
}
disabled={location.protocol === "https:" ||
connectionInProgress}
checked={https}
{...rest}
/>