From 0406832de64dcd2167edadde365c5456ac219a0e Mon Sep 17 00:00:00 2001 From: MMaiero Date: Wed, 20 Nov 2024 10:27:40 +0100 Subject: [PATCH] fix: fixed loading of country code Signed-off-by: MMaiero --- .../web/client/ui/network/TabWirelessUi.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java b/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java index 398c9c6c9bc..7eceea27506 100644 --- a/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java +++ b/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java @@ -361,15 +361,11 @@ public TabWirelessUi(GwtSession currentSession, TabIp4Ui tcp4, TabIp6Ui tcp6, setPasswordValidation(); this.tcp4Tab.status.addChangeHandler(event -> { - evalActiveConfig(); - - update(); + evalActiveConfig(); }); this.tcp6Tab.status.addChangeHandler(event -> { - evalActiveConfig(); - - update(); + evalActiveConfig(); }); logger.info("Constructor done."); @@ -384,8 +380,8 @@ private void evalActiveConfig() { || !tcpIp6Status.equals(TabWirelessUi.this.tcp6Status); if (isStatusChanged) { - if (tcpIp4Status.equals(MessageUtils.get(GwtNetIfStatus.netIPv4StatusEnabledWAN.name())) - || tcpIp6Status.equals(MessageUtils.get(GwtNetIfStatus.netIPv4StatusEnabledWAN.name()))) { + if (tcpIp4Status.equals(GwtNetIfStatus.netIPv4StatusEnabledWAN.name()) + || tcpIp6Status.equals(GwtNetIfStatus.netIPv6StatusEnabledWAN.name())) { TabWirelessUi.this.activeConfig = TabWirelessUi.this.selectedNetIfConfig.getStationWifiConfig(); } else { TabWirelessUi.this.activeConfig = TabWirelessUi.this.selectedNetIfConfig.getActiveWifiConfig(); @@ -394,6 +390,8 @@ private void evalActiveConfig() { TabWirelessUi.this.tcp4Status = tcpIp4Status; TabWirelessUi.this.tcp6Status = tcpIp6Status; TabWirelessUi.this.netTabs.updateTabs(); + + update(); } } } @@ -458,12 +456,6 @@ public void setNetInterface(GwtNetInterfaceConfig config) { this.selectedNetIfConfig = (GwtWifiNetInterfaceConfig) config; this.activeConfig = this.selectedNetIfConfig.getActiveWifiConfig(); - - if (!(this.tcp4Status.equals(GwtNetIfStatus.netIPv4StatusDisabled.getValue()) - && this.tcp6Status.equals(GwtNetIfStatus.netIPv4StatusDisabled.getValue()))) { - - loadCountryCode(); - } } } @@ -740,6 +732,8 @@ private void refreshForm() { if (this.security.getSelectedItemText().equals(WIFI_SECURITY_WPA2_WPA3_ENTERPRISE_MESSAGE)) { this.password.setEnabled(false); } + + loadCountryCode(); } this.netTabs.updateTabs();