diff --git a/src/components/Dialog/NodeOptionsDialog.tsx b/src/components/Dialog/NodeOptionsDialog.tsx
index 10a8d292..06a3f0b8 100644
--- a/src/components/Dialog/NodeOptionsDialog.tsx
+++ b/src/components/Dialog/NodeOptionsDialog.tsx
@@ -1,4 +1,5 @@
import { toast } from "@app/core/hooks/useToast";
+import { useAppStore } from "@app/core/stores/appStore";
import { useDevice } from "@app/core/stores/deviceStore";
import {
Dialog,
@@ -8,6 +9,7 @@ import {
} from "@components/UI/Dialog";
import type { Protobuf } from "@meshtastic/js";
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
+import { TrashIcon } from "lucide-react";
import type { JSX } from "react";
import { Button } from "../UI/Button";
@@ -22,7 +24,8 @@ export const NodeOptionsDialog = ({
open,
onOpenChange,
}: NodeOptionsDialogProps): JSX.Element => {
- const { connection } = useDevice();
+ const { setDialogOpen, connection } = useDevice();
+ const { setNodeNumToBeRemoved } = useAppStore();
const longName =
node?.user?.longName ??
(node ? `!${numberToHexUnpadded(node?.num)}` : "Unknown");
@@ -30,27 +33,27 @@ export const NodeOptionsDialog = ({
node?.user?.shortName ??
(node ? `${numberToHexUnpadded(node?.num).substring(0, 4)}` : "UNK");
- function handleTraceroute() {
+ function handleRequestPosition() {
if (!node) return;
toast({
- title: "Sending Traceroute, please wait...",
+ title: "Requesting position, please wait...",
});
- connection?.traceRoute(node.num).then(() =>
+ connection?.requestPosition(node.num).then(() =>
toast({
- title: "Traceroute sent.",
+ title: "Position request sent.",
}),
);
onOpenChange();
}
- function handleRequestPosition() {
+ function handleTraceroute() {
if (!node) return;
toast({
- title: "Requesting position, please wait...",
+ title: "Sending Traceroute, please wait...",
});
- connection?.requestPosition(node.num).then(() =>
+ connection?.traceRoute(node.num).then(() =>
toast({
- title: "Position request sent.",
+ title: "Traceroute sent.",
}),
);
onOpenChange();
@@ -63,11 +66,24 @@ export const NodeOptionsDialog = ({