Re-issue WiFi scan on the periodic refresh timer

The WiFi page only re-read the access-point list every 3s, so a scan
that was slow, denied, or interrupted left the network list permanently
empty until a manual F5. Re-request the scan on each timer tick (skipped
while a connection attempt is in flight) so results appear automatically
once NetworkManager completes a scan.
This commit is contained in:
NeilClack
2026-08-07 19:41:07 -05:00
parent 7d9b3f19a2
commit c5dac10611
+9
View File
@@ -220,6 +220,15 @@ void WiFiSetupPage::update(float dt) {
refreshTimer_ += dt; refreshTimer_ += dt;
if (refreshTimer_ >= 3.0f) { if (refreshTimer_ >= 3.0f) {
refreshTimer_ = 0.0f; refreshTimer_ = 0.0f;
// Re-issue a scan on every tick rather than only re-reading results:
// NetworkManager only reports access points from completed scans, so a
// slow or failed first scan would otherwise leave the list empty
// forever. Skipped while a connection attempt is running to avoid
// churning the radio mid-connect.
if (state_ && !connectInProgress_) {
state_->network.requestScan();
}
refreshNetworkState(); refreshNetworkState();
// During the First-Run walkthrough, leave the WiFi page automatically // During the First-Run walkthrough, leave the WiFi page automatically