From 2b4c2b16aa90587bbea30d4146995a8d43b47580 Mon Sep 17 00:00:00 2001 From: smiley Date: Fri, 17 Apr 2026 12:53:42 +0300 Subject: [PATCH] Fix AP input popup flow --- src/handler.rs | 16 +++++++++++++++- src/ui.rs | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/handler.rs b/src/handler.rs index 9be3b0f..ce9d5d7 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -634,7 +634,7 @@ pub async fn handle_key_events( FocusedBlock::AccessPointInput => match key_event.code { KeyCode::Enter => { ap.start(sender.clone()).await?; - app.focused_block = FocusedBlock::Device; + app.focused_block = FocusedBlock::AccessPoint; } KeyCode::Esc => { @@ -709,6 +709,20 @@ pub async fn handle_key_events( _ => {} }, + KeyCode::Char(c) if c == config.ap.start => { + if app.focused_block == FocusedBlock::AccessPoint { + ap.ap_start + .store(true, std::sync::atomic::Ordering::Relaxed); + app.focused_block = FocusedBlock::AccessPointInput; + } + } + + KeyCode::Char(c) if c == config.ap.stop => { + if app.focused_block == FocusedBlock::AccessPoint { + ap.stop(sender.clone()).await?; + } + } + _ => { if app.focused_block == FocusedBlock::Device { match key_event.code { diff --git a/src/ui.rs b/src/ui.rs index e78de3d..a12644e 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -23,6 +23,9 @@ pub fn render(app: &mut App, frame: &mut Frame) { Mode::Ap => { if let Some(ap) = &mut app.device.ap { ap.render(frame, app.focused_block, &device, app.config.clone()); + if app.focused_block == FocusedBlock::AccessPointInput { + ap.render_input(frame); + } } } }