WIP updates

This commit is contained in:
Sacha Weatherstone
2022-11-27 22:50:46 +10:00
parent a9561fe622
commit e457cef3da
79 changed files with 2100 additions and 1284 deletions
@@ -6,7 +6,7 @@ import type { AllMessageTypes } from "@core/stores/deviceStore.js";
import { Hashicon } from "@emeraldpay/hashicon-react";
import {
CheckCircleIcon,
EllipsisHorizontalCircleIcon,
EllipsisHorizontalCircleIcon
} from "@heroicons/react/24/outline";
import type { Protobuf } from "@meshtastic/meshtasticjs";
@@ -19,7 +19,7 @@ export interface MessageProps {
export const Message = ({
lastMsgSameUser,
message,
sender,
sender
}: MessageProps): JSX.Element => {
const { setPeerInfoOpen, setActivePeer, connection } = useDevice();
@@ -62,7 +62,7 @@ export const Message = ({
<span className="text-sm">
{new Date(message.packet.rxTime).toLocaleTimeString(undefined, {
hour: "2-digit",
minute: "2-digit",
minute: "2-digit"
})}
</span>
</div>
@@ -20,21 +20,20 @@ export const MessageInput = ({ channel }: MessageInputProps): JSX.Element => {
message: string;
}>({
defaultValues: {
message: "",
},
message: ""
}
});
const onSubmit = handleSubmit((data) => {
void connection?.sendText(
data.message,
undefined,
true,
channel.config.index as Types.ChannelNumber,
(id) => {
void connection?.sendText({
text: data.message,
wantAck: true,
channel: channel.config.index as Types.ChannelNumber,
callback: (id) => {
ackMessage(channel.config.index, id);
return Promise.resolve();
}
);
});
});
return (
@@ -10,7 +10,7 @@ import { Protobuf } from "@meshtastic/meshtasticjs";
enum LocationType {
MGRS,
LatLng,
DecimalDegrees,
DecimalDegrees
}
export const NewLocationMessage = (): JSX.Element => {
@@ -31,14 +31,15 @@ export const NewLocationMessage = (): JSX.Element => {
<Input label="Coordinates" />
<Button
onClick={() => {
void connection?.sendWaypoint(
Protobuf.Waypoint.create({
void connection?.sendWaypoint({
waypoint: Protobuf.Waypoint.create({
latitudeI: Math.floor(3.89103 * 1e7),
longitudeI: Math.floor(105.87005 * 1e7),
name: "TEST",
description: "This is a description",
})
);
description: "This is a description"
}),
destination: "broadcast"
});
}}
>
Send
@@ -9,7 +9,7 @@ export interface WaypointMessageProps {
}
export const WaypointMessage = ({
waypointID,
waypointID
}: WaypointMessageProps): JSX.Element => {
const { waypoints } = useDevice();
const waypoint = waypoints.find((wp) => wp.id === waypointID);