From 4d68f55dfa15725be671676bc667e57b816688a0 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:30:07 -0800 Subject: [PATCH] Fix: omada widget missing switches field, enforce default and max fields (#3047) --- src/widgets/omada/component.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/widgets/omada/component.jsx b/src/widgets/omada/component.jsx index d0565e43c..c4da60677 100644 --- a/src/widgets/omada/component.jsx +++ b/src/widgets/omada/component.jsx @@ -17,12 +17,20 @@ export default function Component({ service }) { return ; } + if (!widget.fields) { + widget.fields = ["connectedAp", "activeUser", "alerts", "connectedGateway"]; + } else if (widget.fields?.length > 4) { + widget.fields = widget.fields.slice(0, 4); + } + if (!omadaData) { return ( + + ); } @@ -32,9 +40,8 @@ export default function Component({ service }) { - {omadaData.connectedGateways > 0 && ( - - )} + + ); }