continuation of the fixes

This commit is contained in:
filipriec
2025-04-14 14:05:20 +02:00
parent adcd3b37fa
commit f2a63476b3
4 changed files with 10 additions and 8 deletions

View File

@@ -3,7 +3,9 @@ use crate::state::pages::admin::AdminState;
pub fn handle_admin_selection(app_state: &mut AppState, admin_state: &AdminState) {
let profiles = &app_state.profile_tree.profiles;
if !profiles.is_empty() && app_state.general.selected_item < profiles.len() {
app_state.selected_profile = Some(profiles[app_state.general.selected_item].name.clone());
if let Some(selected_index) = admin_state.get_selected_index() {
if let Some(profile) = profiles.get(selected_index) {
app_state.selected_profile = Some(profile.name.clone());
}
}
}