From 3b018b0c70ac0c3eaa76d30604bd72c1b849a6fd Mon Sep 17 00:00:00 2001 From: Hunter Thornsberry Date: Sun, 15 Sep 2024 19:23:07 -0400 Subject: [PATCH 1/3] Only allow channel index 0 to be PRIMARY --- src/components/PageComponents/Channel.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/PageComponents/Channel.tsx b/src/components/PageComponents/Channel.tsx index d90e950b..75545f57 100644 --- a/src/components/PageComponents/Channel.tsx +++ b/src/components/PageComponents/Channel.tsx @@ -111,10 +111,11 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => { type: "select", name: "role", label: "Role", + disabled: channel.index == 0, description: "Device telemetry is sent over PRIMARY. Only one PRIMARY allowed", properties: { - enumValue: Protobuf.Channel.Channel_Role, + enumValue: channel.index === 0 ? {"PRIMARY":1} : {"DISABLED":0, "SECONDARY":2}, }, }, { From f2aa5bfbee30b27fa2a3d4a32ba3ce115836d640 Mon Sep 17 00:00:00 2001 From: Hunter Thornsberry Date: Sun, 15 Sep 2024 19:23:44 -0400 Subject: [PATCH 2/3] biome --- src/components/PageComponents/Channel.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/PageComponents/Channel.tsx b/src/components/PageComponents/Channel.tsx index 75545f57..3a3406c9 100644 --- a/src/components/PageComponents/Channel.tsx +++ b/src/components/PageComponents/Channel.tsx @@ -115,7 +115,10 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => { description: "Device telemetry is sent over PRIMARY. Only one PRIMARY allowed", properties: { - enumValue: channel.index === 0 ? {"PRIMARY":1} : {"DISABLED":0, "SECONDARY":2}, + enumValue: + channel.index === 0 + ? { PRIMARY: 1 } + : { DISABLED: 0, SECONDARY: 2 }, }, }, { From 2654e4fbc900e98cc389497a8b3cd6846a0f116e Mon Sep 17 00:00:00 2001 From: Hunter Thornsberry Date: Sun, 15 Sep 2024 19:24:16 -0400 Subject: [PATCH 3/3] biome manual fixes --- src/components/PageComponents/Channel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PageComponents/Channel.tsx b/src/components/PageComponents/Channel.tsx index 3a3406c9..293a5cad 100644 --- a/src/components/PageComponents/Channel.tsx +++ b/src/components/PageComponents/Channel.tsx @@ -111,7 +111,7 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => { type: "select", name: "role", label: "Role", - disabled: channel.index == 0, + disabled: channel.index === 0, description: "Device telemetry is sent over PRIMARY. Only one PRIMARY allowed", properties: {