| undefined;
@@ -20,15 +19,13 @@ export const LocationResponseDialog = ({
location,
open,
onOpenChange,
-}: LocationResponseDialogProps): JSX.Element => {
+}: LocationResponseDialogProps) => {
const { nodes } = useDevice();
const from = nodes.get(location?.from ?? 0);
- const longName =
- from?.user?.longName ??
+ const longName = from?.user?.longName ??
(from ? `!${numberToHexUnpadded(from?.num)}` : "Unknown");
- const shortName =
- from?.user?.shortName ??
+ const shortName = from?.user?.shortName ??
(from ? `${numberToHexUnpadded(from?.num).substring(0, 4)}` : "UNK");
return (
diff --git a/src/components/Dialog/NewDeviceDialog.tsx b/src/components/Dialog/NewDeviceDialog.tsx
index 6be6d58d..192c51a6 100644
--- a/src/components/Dialog/NewDeviceDialog.tsx
+++ b/src/components/Dialog/NewDeviceDialog.tsx
@@ -1,7 +1,7 @@
import {
type BrowserFeature,
useBrowserFeatureDetection,
-} from "@app/core/hooks/useBrowserFeatureDetection";
+} from "../../core/hooks/useBrowserFeatureDetection.ts";
import { BLE } from "@components/PageComponents/Connect/BLE.tsx";
import { HTTP } from "@components/PageComponents/Connect/HTTP.tsx";
import { Serial } from "@components/PageComponents/Connect/Serial.tsx";
@@ -18,9 +18,9 @@ import {
TabsTrigger,
} from "@components/UI/Tabs.tsx";
import { Subtle } from "@components/UI/Typography/Subtle.tsx";
-import { AlertCircle, InfoIcon } from "lucide-react";
-import { Fragment, type JSX } from "react/jsx-runtime";
-import { Link } from "../UI/Typography/Link";
+import { AlertCircle } from "lucide-react";
+import { Link } from "../UI/Typography/Link.tsx";
+import { Fragment } from "react/jsx-runtime";
export interface TabElementProps {
closeDialog: () => void;
@@ -85,14 +85,16 @@ const ErrorMessage = ({ missingFeatures }: FeatureErrorProps) => {
{browserFeatures.length > 0 && (
<>
- This application requires {formatFeatureList(browserFeatures)}.
- Please use a Chromium-based browser like Chrome or Edge.
+ This application requires{" "}
+ {formatFeatureList(browserFeatures)}. Please use a
+ Chromium-based browser like Chrome or Edge.
>
)}
{needsSecureContext && (
<>
{browserFeatures.length > 0 && " Additionally, it"}
- {browserFeatures.length === 0 && "This application"} requires a{" "}
+ {browserFeatures.length === 0 && "This application"} requires a
+ {" "}
secure context.
Please connect using HTTPS or localhost.
>
@@ -107,7 +109,7 @@ const ErrorMessage = ({ missingFeatures }: FeatureErrorProps) => {
export const NewDeviceDialog = ({
open,
onOpenChange,
-}: NewDeviceProps): JSX.Element => {
+}: NewDeviceProps) => {
const { unsupported } = useBrowserFeatureDetection();
const tabs: TabManifest[] = [
@@ -119,15 +121,13 @@ export const NewDeviceDialog = ({
{
label: "Bluetooth",
element: BLE,
- isDisabled:
- unsupported.includes("Web Bluetooth") ||
+ isDisabled: unsupported.includes("Web Bluetooth") ||
unsupported.includes("Secure Context"),
},
{
label: "Serial",
element: Serial,
- isDisabled:
- unsupported.includes("Web Serial") ||
+ isDisabled: unsupported.includes("Web Serial") ||
unsupported.includes("Secure Context"),
},
];
@@ -149,9 +149,9 @@ export const NewDeviceDialog = ({
{tabs.map((tab) => (
diff --git a/src/components/Dialog/NodeDetailsDialog.tsx b/src/components/Dialog/NodeDetailsDialog.tsx
index ab76aa2f..c84af0b2 100644
--- a/src/components/Dialog/NodeDetailsDialog.tsx
+++ b/src/components/Dialog/NodeDetailsDialog.tsx
@@ -1,23 +1,23 @@
-import { useAppStore } from "@app/core/stores/appStore";
-import { useDevice } from "@app/core/stores/deviceStore";
+import { useAppStore } from "../../core/stores/appStore.ts";
+import { useDevice } from "../../core/stores/deviceStore.ts";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
-} from "@components/UI/Accordion";
+} from "../UI/Accordion.tsx";
import {
Dialog,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
-} from "@components/UI/Dialog";
+} from "../UI/Dialog.tsx";
import { Protobuf } from "@meshtastic/core";
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
-import { DeviceImage } from "../generic/DeviceImage";
-import { TimeAgo } from "../generic/TimeAgo";
-import { Uptime } from "../generic/Uptime";
+import { DeviceImage } from "../generic/DeviceImage.tsx";
+import { TimeAgo } from "../generic/TimeAgo.tsx";
+import { Uptime } from "../generic/Uptime.tsx";
export interface NodeDetailsDialogProps {
open: boolean;
@@ -32,134 +32,159 @@ export const NodeDetailsDialog = ({
const { nodeNumDetails } = useAppStore();
const device: Protobuf.Mesh.NodeInfo = nodes.get(nodeNumDetails);
- return device ? (
-
+ )
+ : null;
};
diff --git a/src/components/Dialog/NodeOptionsDialog.tsx b/src/components/Dialog/NodeOptionsDialog.tsx
index 0161bb22..34603f6f 100644
--- a/src/components/Dialog/NodeOptionsDialog.tsx
+++ b/src/components/Dialog/NodeOptionsDialog.tsx
@@ -1,17 +1,17 @@
-import { toast } from "@app/core/hooks/useToast";
-import { useAppStore } from "@app/core/stores/appStore";
-import { useDevice } from "@app/core/stores/deviceStore";
+import { toast } from "../../core/hooks/useToast.ts";
+import { useAppStore } from "../../core/stores/appStore.ts";
+import { useDevice } from "../../core/stores/deviceStore.ts";
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
-} from "@components/UI/Dialog";
+} from "../UI/Dialog.tsx";
import type { Protobuf } from "@meshtastic/core";
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
import { TrashIcon } from "lucide-react";
-import type { JSX } from "react";
-import { Button } from "../UI/Button";
+
+import { Button } from "../UI/Button.tsx";
export interface NodeOptionsDialogProps {
node: Protobuf.Mesh.NodeInfo | undefined;
@@ -23,7 +23,7 @@ export const NodeOptionsDialog = ({
node,
open,
onOpenChange,
-}: NodeOptionsDialogProps): JSX.Element => {
+}: NodeOptionsDialogProps) => {
const { setDialogOpen, connection, setActivePage } = useDevice();
const {
setNodeNumToBeRemoved,
@@ -31,11 +31,9 @@ export const NodeOptionsDialog = ({
setChatType,
setActiveChat,
} = useAppStore();
- const longName =
- node?.user?.longName ??
+ const longName = node?.user?.longName ??
(node ? `!${numberToHexUnpadded(node?.num)}` : "Unknown");
- const shortName =
- node?.user?.shortName ??
+ const shortName = node?.user?.shortName ??
(node ? `${numberToHexUnpadded(node?.num).substring(0, 4)}` : "UNK");
function handleDirectMessage() {
@@ -53,7 +51,7 @@ export const NodeOptionsDialog = ({
connection?.requestPosition(node.num).then(() =>
toast({
title: "Position request sent.",
- }),
+ })
);
onOpenChange();
}
@@ -66,7 +64,7 @@ export const NodeOptionsDialog = ({
connection?.traceRoute(node.num).then(() =>
toast({
title: "Traceroute sent.",
- }),
+ })
);
onOpenChange();
}
diff --git a/src/components/Dialog/PKIBackupDialog.tsx b/src/components/Dialog/PKIBackupDialog.tsx
index 9b6c18d8..7304ba03 100644
--- a/src/components/Dialog/PKIBackupDialog.tsx
+++ b/src/components/Dialog/PKIBackupDialog.tsx
@@ -1,5 +1,5 @@
-import { useDevice } from "@app/core/stores/deviceStore";
-import { Button } from "@components/UI/Button";
+import { useDevice } from "../../core/stores/deviceStore.ts";
+import { Button } from "../UI/Button.tsx";
import {
Dialog,
DialogContent,
@@ -40,7 +40,7 @@ export const PkiBackupDialog = ({
const renderPrintWindow = React.useCallback(() => {
if (!privateKey || !publicKey) return;
- const printWindow = window.open("", "_blank");
+ const printWindow = globalThis.open("", "_blank");
if (printWindow) {
printWindow.document.write(`
@@ -116,14 +116,14 @@ export const PkiBackupDialog = ({
-