From 731d63c19ceef50c931ef751ab74dfe2cc20c2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zachary=20Gu=C3=A9not?= Date: Wed, 9 Sep 2026 02:35:43 +0200 Subject: [PATCH] fix(widgets): stop asserting a gateway that does not exist, label the ISP gap Co-Authored-By: Claude Opus 5 --- packages/translation/src/lang/en.json | 1 + packages/widgets/src/unifi-os/component.tsx | 23 ++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/translation/src/lang/en.json b/packages/translation/src/lang/en.json index ee17567a6..509b12a36 100644 --- a/packages/translation/src/lang/en.json +++ b/packages/translation/src/lang/en.json @@ -4236,6 +4236,7 @@ }, "card": { "internet": "Internet", + "isp": "ISP", "latency": "{value} ms", "measuredAt": "Measured at {time}", "clients": "Clients", diff --git a/packages/widgets/src/unifi-os/component.tsx b/packages/widgets/src/unifi-os/component.tsx index 33e6405eb..cc05fc86b 100644 --- a/packages/widgets/src/unifi-os/component.tsx +++ b/packages/widgets/src/unifi-os/component.tsx @@ -86,9 +86,14 @@ export default function UnifiOsWidget({ integrationIds, options }: WidgetCompone {options.showIsp && ( {summary.wan.isp === null ? ( - - {EMPTY_VALUE} - + <> + + {t("widget.unifiOs.card.isp")} + + + {EMPTY_VALUE} + + ) : ( <> @@ -166,11 +171,13 @@ export default function UnifiOsWidget({ integrationIds, options }: WidgetCompone {t("widget.unifiOs.card.version", { version: summary.site.applicationVersion })} - - {t("widget.unifiOs.card.gatewayUptime", { - uptime: summary.gateway?.uptimeSec != null ? formatUptime(summary.gateway.uptimeSec) : EMPTY_VALUE, - })} - + {(summary.devices === null || summary.gateway !== null) && ( + + {t("widget.unifiOs.card.gatewayUptime", { + uptime: summary.gateway?.uptimeSec != null ? formatUptime(summary.gateway.uptimeSec) : EMPTY_VALUE, + })} + + )} );