Skip to content

Commit

Permalink
gui: Fix invalid display of static due to WI_SWITCH initialization in…
Browse files Browse the repository at this point in the history
… MI_NET_IP
  • Loading branch information
bkerler authored and CZDanol committed Oct 23, 2024
1 parent bb8b089 commit 8a788ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/MItem_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ MI_NET_IP::MI_NET_IP(NetDeviceID device_id)
: WI_SWITCH_t(0, string_view_utf8::MakeCPUFLASH(label), nullptr, is_enabled_t::yes, is_hidden_t::no, string_view_utf8::MakeCPUFLASH(str_DHCP), string_view_utf8::MakeCPUFLASH(str_static))
, device_id(device_id) //
{
index = netdev_get_ip_obtained_type(this->device_id());
this->SetIndex(netdev_get_ip_obtained_type(this->device_id()));
}

void MI_NET_IP::OnChange([[maybe_unused]] size_t old_index) {
const auto dev_id = device_id();
if (index == NETDEV_STATIC) {
if (this->GetIndex() == NETDEV_STATIC) {
netdev_set_static(dev_id);
} else {
netdev_set_dhcp(dev_id);
Expand Down

0 comments on commit 8a788ae

Please sign in to comment.