uds ipc working

This commit is contained in:
2026-03-08 19:07:37 +01:00
parent dcc863c451
commit 54ddc9851c
6 changed files with 64 additions and 2 deletions

View File

@ -60,7 +60,7 @@ fn run_app(terminal: &mut Terminal<CrosstermBackend<io::Stdout>>, app: &mut App)
}
KeyCode::Char('d') => {
if last_key_was_d {
app.delete_selected();
app.mode = Mode::ConfirmDelete;
last_key_was_d = false;
} else {
last_key_was_d = true;
@ -150,6 +150,19 @@ fn run_app(terminal: &mut Terminal<CrosstermBackend<io::Stdout>>, app: &mut App)
}
_ => {}
},
Mode::ConfirmDelete => match key.code {
KeyCode::Char('y') | KeyCode::Char('Y') | KeyCode::Enter => {
if let Some(selected) = app.get_selected_item() {
crate::ipc::delete_entry(selected.clone());
app.delete_selected();
}
app.mode = Mode::Normal;
}
KeyCode::Char('n') | KeyCode::Char('N') | KeyCode::Esc => {
app.mode = Mode::Normal;
}
_ => {}
},
}
}
} else {