fix for Map crash on unsupported hwModel in Node.
This commit is contained in:
@@ -26,9 +26,9 @@ export interface NodeDetailProps {
|
|||||||
|
|
||||||
export const NodeDetail = ({ node }: NodeDetailProps) => {
|
export const NodeDetail = ({ node }: NodeDetailProps) => {
|
||||||
const name = node.user?.longName || `!${numberToHexUnpadded(node.num)}`;
|
const name = node.user?.longName || `!${numberToHexUnpadded(node.num)}`;
|
||||||
const hardwareType = Protobuf.Mesh.HardwareModel[
|
const hwModel = node.user?.hwModel ?? 0;
|
||||||
node.user?.hwModel ?? 0
|
const hardwareType =
|
||||||
].replaceAll("_", " ");
|
Protobuf.Mesh.HardwareModel[hwModel]?.replaceAll("_", " ") ?? `${hwModel}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="dark:text-black p-1">
|
<div className="dark:text-black p-1">
|
||||||
|
|||||||
Reference in New Issue
Block a user