Skip to content

Commit

Permalink
fixup! console: Conditionally show WiFi and ethernet config and conne…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
johanstokking committed Dec 16, 2024
1 parent 2353df9 commit c95b393
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ const GatewayConnectionSettings = () => {

const updateInitialWifiProfile = useCallback(
(profile, entityId, isNonSharedProfile) => ({
...initialWifiProfile,
...(isNonSharedProfile && { ...profile.data }),
profile_id: isNonSharedProfile
? 'non-shared'
Expand All @@ -209,6 +210,7 @@ const GatewayConnectionSettings = () => {

const updateInitialEthernetProfile = useCallback(
profile => ({
...initialEthernetProfile,
...revertEthernetProfile(profile?.data ?? {}),
profile_id: selectedManagedGateway.ethernet_profile_id ?? '',
}),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c95b393

Please sign in to comment.