Fix message ack's
This commit is contained in:
@@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
|
||||
|
||||
import { fromByteArray, toByteArray } from "base64-js";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
import { toast } from "react-hot-toast";
|
||||
|
||||
import { Input } from "@app/components/form/Input.js";
|
||||
import { Form } from "@components/form/Form";
|
||||
|
||||
@@ -31,7 +31,7 @@ export const Message = ({
|
||||
return lastMsgSameUser ? (
|
||||
<div className="ml-4 flex">
|
||||
{message.ack ? (
|
||||
<CheckCircleIcon className="my-auto h-4 text-slate-200" />
|
||||
<CheckCircleIcon className="my-auto h-4 text-slate-400" />
|
||||
) : (
|
||||
<EllipsisHorizontalCircleIcon className="my-auto h-4 text-slate-200" />
|
||||
)}
|
||||
@@ -68,7 +68,7 @@ export const Message = ({
|
||||
</div>
|
||||
<div className="flex">
|
||||
{message.ack ? (
|
||||
<CheckCircleIcon className="my-auto h-4 text-slate-200" />
|
||||
<CheckCircleIcon className="my-auto h-4 text-slate-400" />
|
||||
) : (
|
||||
<EllipsisHorizontalCircleIcon className="my-auto h-4 text-slate-200" />
|
||||
)}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import toast from "react-hot-toast";
|
||||
import { toast } from "react-hot-toast";
|
||||
|
||||
import type { Device } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
||||
@@ -7,6 +7,7 @@ export const subscribeAll = (
|
||||
device: Device,
|
||||
connection: Types.ConnectionType
|
||||
) => {
|
||||
let myNodeNum = 0;
|
||||
connection.setLogLevel(Protobuf.LogRecord_Level.TRACE);
|
||||
|
||||
// onLogEvent
|
||||
@@ -37,13 +38,14 @@ export const subscribeAll = (
|
||||
device.addWaypoint(data);
|
||||
device.addWaypointMessage({
|
||||
waypointID: data.id,
|
||||
ack: rest.packet.from !== device.hardware.myNodeNum,
|
||||
ack: rest.packet.from !== myNodeNum,
|
||||
...rest,
|
||||
});
|
||||
});
|
||||
|
||||
connection.onMyNodeInfo.subscribe((nodeInfo) => {
|
||||
device.setHardware(nodeInfo);
|
||||
myNodeNum = nodeInfo.myNodeNum;
|
||||
});
|
||||
|
||||
connection.onUserPacket.subscribe((user) => {
|
||||
@@ -78,7 +80,7 @@ export const subscribeAll = (
|
||||
connection.onMessagePacket.subscribe((messagePacket) => {
|
||||
device.addMessage({
|
||||
...messagePacket,
|
||||
ack: messagePacket.packet.from !== device.hardware.myNodeNum,
|
||||
ack: messagePacket.packet.from !== myNodeNum,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user