This commit is contained in:
filipriec
2025-03-23 12:56:27 +01:00
parent 83393a20e2
commit 4ddcb34205
2 changed files with 4 additions and 9 deletions

View File

@@ -82,7 +82,6 @@ impl EventHandler {
// Handle down movement using app_state // Handle down movement using app_state
app_state.admin_selected_item = app_state.admin_selected_item.saturating_add(1); app_state.admin_selected_item = app_state.admin_selected_item.saturating_add(1);
} }
"quit" => app_state.ui.show_admin = false,
_ => {} _ => {}
} }
return Ok((false, format!("Admin: {}", action))); return Ok((false, format!("Admin: {}", action)));

View File

@@ -43,15 +43,11 @@ pub fn render_ui(
if app_state.ui.show_intro { if app_state.ui.show_intro {
intro_state.render(f, main_content_area, theme); intro_state.render(f, main_content_area, theme);
} else if app_state.ui.show_admin { } else if app_state.ui.show_admin {
// Create a temporary AdminPanelState using app_state data // Create temporary AdminPanelState using app_state data
let mut admin_panel_state = AdminPanelState::new(app_state.admin_profiles.clone()); let mut admin_state = AdminPanelState::new(app_state.admin_profiles.clone());
admin_state.list_state.select(Some(app_state.admin_selected_item));
// Set the selected item admin_state.render(
if !app_state.admin_profiles.is_empty() {
admin_panel_state.list_state.select(Some(app_state.admin_selected_item));
}
admin_panel_state.render(
f, f,
main_content_area, main_content_area,
theme, theme,