From 0cd26d9217545709b6b89d5f9f686b15fc8c359f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 3 Apr 2019 10:21:20 -0700 Subject: [PATCH] handle missing device ports --- src/RouterSettings/PortColumns.js | 4 ++++ src/locales/en/translations.json | 1 + 2 files changed, 5 insertions(+) diff --git a/src/RouterSettings/PortColumns.js b/src/RouterSettings/PortColumns.js index 60f66da3..f2595839 100644 --- a/src/RouterSettings/PortColumns.js +++ b/src/RouterSettings/PortColumns.js @@ -1,6 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; +import { Alert } from "reactstrap"; import { PortColumn, PortNumber, PortToggle } from "./PortStyles.js"; import portOrderings from "../portOrderings"; @@ -10,6 +11,9 @@ const PortColumns = ({ device, interfaces, setInterfaceMode }) => { let [t] = useTranslation(); let modes = [t("LAN"), t("Mesh"), t("WAN")]; + if (!portOrderings[device]) + return {t("deviceNotRecognized")}; + return (
{portOrderings[device].map((iface, i) => { diff --git a/src/locales/en/translations.json b/src/locales/en/translations.json index b50ea53c..1c658682 100644 --- a/src/locales/en/translations.json +++ b/src/locales/en/translations.json @@ -36,6 +36,7 @@ "debuggingMessage": "{{show}} advanced debugging message", "deposit": "Deposit", "depositFunds": "Deposit Funds", + "deviceNotRecognized": "Could not find port settings for your device", "edit": "Edit", "email": "Email", "emailAddress": "Email Address",