Browse Source

fix for Map crash on unsupported hwModel in Node.

pull/430/head
PhotoNomad0 1 year ago
parent
commit
61529675ec
  1. 6
      src/components/PageComponents/Map/NodeDetail.tsx

6
src/components/PageComponents/Map/NodeDetail.tsx

@ -26,9 +26,9 @@ export interface NodeDetailProps {
export const NodeDetail = ({ node }: NodeDetailProps) => {
const name = node.user?.longName || `!${numberToHexUnpadded(node.num)}`;
const hardwareType = Protobuf.Mesh.HardwareModel[
node.user?.hwModel ?? 0
].replaceAll("_", " ");
const hwModel = node.user?.hwModel ?? 0;
const hardwareType =
Protobuf.Mesh.HardwareModel[hwModel]?.replaceAll("_", " ") ?? `${hwModel}`;
return (
<div className="dark:text-black p-1">

Loading…
Cancel
Save