From 83393a20e2a310092597a59b37079ad895d9717c Mon Sep 17 00:00:00 2001 From: filipriec Date: Sun, 23 Mar 2025 12:44:33 +0100 Subject: [PATCH] fix of the error --- client/src/ui/handlers/render.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/ui/handlers/render.rs b/client/src/ui/handlers/render.rs index 052cadc..d84aceb 100644 --- a/client/src/ui/handlers/render.rs +++ b/client/src/ui/handlers/render.rs @@ -43,6 +43,14 @@ pub fn render_ui( if app_state.ui.show_intro { intro_state.render(f, main_content_area, theme); } else if app_state.ui.show_admin { + // Create a temporary AdminPanelState using app_state data + let mut admin_panel_state = AdminPanelState::new(app_state.admin_profiles.clone()); + + // Set the selected item + if !app_state.admin_profiles.is_empty() { + admin_panel_state.list_state.select(Some(app_state.admin_selected_item)); + } + admin_panel_state.render( f, main_content_area,