Skip to content

Commit c95b393

Browse files
committed
fixup! console: Conditionally show WiFi and ethernet config and connections
1 parent 2353df9 commit c95b393

File tree

1 file changed

+3
-10
lines changed
  • pkg/webui/console/containers/gateway-managed-gateway/connection-settings

1 file changed

+3
-10
lines changed

pkg/webui/console/containers/gateway-managed-gateway/connection-settings/index.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ const GatewayConnectionSettings = () => {
196196

197197
const updateInitialWifiProfile = useCallback(
198198
(profile, entityId, isNonSharedProfile) => ({
199+
...initialWifiProfile,
199200
...(isNonSharedProfile && { ...profile.data }),
200201
profile_id: isNonSharedProfile
201202
? 'non-shared'
@@ -209,6 +210,7 @@ const GatewayConnectionSettings = () => {
209210

210211
const updateInitialEthernetProfile = useCallback(
211212
profile => ({
213+
...initialEthernetProfile,
212214
...revertEthernetProfile(profile?.data ?? {}),
213215
profile_id: selectedManagedGateway.ethernet_profile_id ?? '',
214216
}),
@@ -248,16 +250,7 @@ const GatewayConnectionSettings = () => {
248250
newValues.ethernet_profile = updateInitialEthernetProfile(ethernetProfile)
249251
}
250252

251-
setInitialValues(oldValues => ({
252-
...oldValues,
253-
...newValues,
254-
...(hasWifi && {
255-
wifi_profile: {
256-
...oldValues.wifi_profile,
257-
...newValues.wifi_profile,
258-
},
259-
}),
260-
}))
253+
setInitialValues(oldValues => ({ ...oldValues, ...newValues }))
261254
},
262255
[
263256
fetchEthernetProfile,

0 commit comments

Comments
 (0)