From ef0b070fd6252d6c69bac5b693d8d6f46a532daa Mon Sep 17 00:00:00 2001 From: Johan Stokking Date: Fri, 13 Dec 2024 16:41:52 +0100 Subject: [PATCH] fixup! console: Conditionally show WiFi and ethernet config and connections --- .../connection-settings/index.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/webui/console/containers/gateway-managed-gateway/connection-settings/index.js b/pkg/webui/console/containers/gateway-managed-gateway/connection-settings/index.js index d874f789091..c18ccadfaee 100644 --- a/pkg/webui/console/containers/gateway-managed-gateway/connection-settings/index.js +++ b/pkg/webui/console/containers/gateway-managed-gateway/connection-settings/index.js @@ -248,7 +248,18 @@ const GatewayConnectionSettings = () => { newValues.ethernet_profile = updateInitialEthernetProfile(ethernetProfile) } - setInitialValues(oldValues => ({ ...oldValues, ...newValues })) + setInitialValues(oldValues => ({ + ...oldValues, + ...(hasWifi && { + wifi_profile: { + ...oldValues.wifi_profile, + ...newValues.wifi_profile, + }, + }), + ...(hasEthernet && { + ethernet_profile: newValues.ethernet_profile, + }), + })) }, [ fetchEthernetProfile, @@ -328,7 +339,7 @@ const GatewayConnectionSettings = () => { setError(undefined) try { - let body = {} + const body = {} const { wifi_profile, ethernet_profile } = values if (hasWifi) {