Skip to content

Fix stay_in_settings_menu loop error with conditional - #28

Merged
e-tho merged 1 commit into
e-tho:mainfrom
DreamTone:settings_menu_fix
Aug 25, 2026
Merged

Fix stay_in_settings_menu loop error with conditional#28
e-tho merged 1 commit into
e-tho:mainfrom
DreamTone:settings_menu_fix

Conversation

@DreamTone

@DreamTone DreamTone commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

The while stay_in_settings_menu loop in src/app.rs needs an additional conditional to prevent errors when the --interaction argument is used.

Problem 1:
Settings -> Station Mode -> Disable Adapter -> Esc Key

stay_in_settings_menu = true and the program remains in the while stay_in_settings_menu loop and errors out at self.adapter.refresh().await?;. The adapter device is powered off and self.adapter.refresh() exits with errors. The program needs to exit the loop to exit gracefully.

Problem 2:
Settings -> Station Mode -> Settings -> Access Point Mode -> Disable Adapter -> Esc Key

This causes multiple problems as the menu remains in the Settings menu. Disable Adapter is showing even though it's already disabled. If you press Esc it cycles between Power On Device menu and the Settings menu. If you select Disable Adapter then press Esc you're stuck in an infinite loop of doing that. If you select Access Point then press Esc you go back to the Power on Device menu.

Solution:
Add at line 407 in src/app.rs:

if !self.running {
    stay_in_settings_menu = false;
}

When pressing both Esc during the Power on Device menu and when pressing Access Point Mode, self.running = false, so setting stay_in_settings_menu = false exits the loop and keeps the program executing as intended. Problem 1 exits gracefully and problem 2 returns to the main menu and continues functioning properly. When self.running = true, remaining in the loop keeps the program functioning properly.

@e-tho
e-tho merged commit ebd9212 into e-tho:main Aug 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants