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 1501104468..8b489dfe3c 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 @@ -196,6 +196,7 @@ const GatewayConnectionSettings = () => { const updateInitialWifiProfile = useCallback( (profile, entityId, isNonSharedProfile) => ({ + ...initialWifiProfile, ...(isNonSharedProfile && { ...profile.data }), profile_id: isNonSharedProfile ? 'non-shared' @@ -209,6 +210,7 @@ const GatewayConnectionSettings = () => { const updateInitialEthernetProfile = useCallback( profile => ({ + ...initialEthernetProfile, ...revertEthernetProfile(profile?.data ?? {}), profile_id: selectedManagedGateway.ethernet_profile_id ?? '', }), @@ -248,16 +250,7 @@ const GatewayConnectionSettings = () => { newValues.ethernet_profile = updateInitialEthernetProfile(ethernetProfile) } - setInitialValues(oldValues => ({ - ...oldValues, - ...newValues, - ...(hasWifi && { - wifi_profile: { - ...oldValues.wifi_profile, - ...newValues.wifi_profile, - }, - }), - })) + setInitialValues(oldValues => ({ ...oldValues, ...newValues })) }, [ fetchEthernetProfile,