Fix selected when there are no rows

This commit is contained in:
mo8it
2024-04-11 14:35:30 +02:00
parent 686143100f
commit 470dc65956
2 changed files with 53 additions and 26 deletions
+3 -1
View File
@@ -72,7 +72,9 @@ pub fn list(app_state: &mut AppState) -> Result<()> {
ui_state.message.push_str(message);
}
KeyCode::Char('r') => {
let exercise = ui_state.reset_selected()?;
let Some(exercise) = ui_state.reset_selected()? else {
continue;
};
ui_state = ui_state.with_updated_rows();
ui_state