diff --git a/src/gui/MItem_network.cpp b/src/gui/MItem_network.cpp index 5a77bb52b..f4350e3c9 100644 --- a/src/gui/MItem_network.cpp +++ b/src/gui/MItem_network.cpp @@ -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);