Browse Source

Add fix

pull/467/head
Tilen Komel 1 year ago
parent
commit
379ac46ec8
  1. 16
      src/pages/Nodes.tsx

16
src/pages/Nodes.tsx

@ -63,9 +63,10 @@ const NodesPage = (): JSX.Element => {
const handleLocation = useCallback( const handleLocation = useCallback(
(location: Types.PacketMetadata<Protobuf.Mesh.Position>) => { (location: Types.PacketMetadata<Protobuf.Mesh.Position>) => {
if (location.to.valueOf() !== hardware.myNodeNum) return;
setSelectedLocation(location); setSelectedLocation(location);
}, },
[], [hardware.myNodeNum],
); );
return ( return (
@ -107,8 +108,8 @@ const NodesPage = (): JSX.Element => {
{node.user?.shortName ?? {node.user?.shortName ??
(node.user?.macaddr (node.user?.macaddr
? `${base16 ? `${base16
.stringify(node.user?.macaddr.subarray(4, 6) ?? []) .stringify(node.user?.macaddr.subarray(4, 6) ?? [])
.toLowerCase()}` .toLowerCase()}`
: `${numberToHexUnpadded(node.num).slice(-4)}`)} : `${numberToHexUnpadded(node.num).slice(-4)}`)}
</h1>, </h1>,
@ -120,8 +121,8 @@ const NodesPage = (): JSX.Element => {
{node.user?.longName ?? {node.user?.longName ??
(node.user?.macaddr (node.user?.macaddr
? `Meshtastic ${base16 ? `Meshtastic ${base16
.stringify(node.user?.macaddr.subarray(4, 6) ?? []) .stringify(node.user?.macaddr.subarray(4, 6) ?? [])
.toLowerCase()}` .toLowerCase()}`
: `!${numberToHexUnpadded(node.num)}`)} : `!${numberToHexUnpadded(node.num)}`)}
</h1>, </h1>,
@ -157,9 +158,8 @@ const NodesPage = (): JSX.Element => {
{node.lastHeard !== 0 {node.lastHeard !== 0
? node.viaMqtt === false && node.hopsAway === 0 ? node.viaMqtt === false && node.hopsAway === 0
? "Direct" ? "Direct"
: `${node.hopsAway.toString()} ${ : `${node.hopsAway.toString()} ${node.hopsAway > 1 ? "hops" : "hop"
node.hopsAway > 1 ? "hops" : "hop" } away`
} away`
: "-"} : "-"}
{node.viaMqtt === true ? ", via MQTT" : ""} {node.viaMqtt === true ? ", via MQTT" : ""}
</Mono>, </Mono>,

Loading…
Cancel
Save