prevent duplicate scan triggers

This commit is contained in:
notiant
2026-03-22 23:10:01 +01:00
committed by GitHub
parent 849bf16388
commit a624421047
2 changed files with 10 additions and 18 deletions
+8 -7
View File
@@ -36,6 +36,7 @@ SmartPanel {
ethernetInfoExpanded = false;
if (NetworkService.wifiEnabled && !NetworkService.scanningActive) {
NetworkService.scan();
NetworkService.refreshActiveWifiDetails();
}
} else {
if (NetworkService.ethernetConnected) {
@@ -50,11 +51,13 @@ SmartPanel {
onEffectivelyVisibleChanged: {
if (effectivelyVisible) {
SystemStatService.registerComponent("network-panel");
NetworkService.scan();
// Preload active WiFi details so Info shows instantly
NetworkService.refreshActiveWifiDetails();
// Also fetch Ethernet details if connected
NetworkService.refreshActiveEthernetDetails();
if (NetworkService.wifiEnabled && !NetworkService.scanningActive) {
NetworkService.scan();
NetworkService.refreshActiveWifiDetails();
}
if (NetworkService.ethernetConnected) {
NetworkService.refreshActiveEthernetDetails();
}
} else {
SystemStatService.unregisterComponent("network-panel");
}
@@ -178,14 +181,12 @@ SmartPanel {
text: I18n.tr("common.wifi")
tabIndex: 0
checked: modeTabBar.currentIndex === 0
enabled: NetworkService.wifiAvailable
}
NTabButton {
text: I18n.tr("common.ethernet")
tabIndex: 1
checked: modeTabBar.currentIndex === 1
enabled: NetworkService.ethernetAvailable
}
}
}