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());
}
}
}

View File

@@ -147,7 +147,7 @@ pub async fn back_to_main(
// Reset focus state
app_state.ui.focus_outside_canvas = false;
app_state.button_focus_index = 0;
app_state.focused_button_index = 0;
"Returned to main menu".to_string()
}

View File

@@ -21,7 +21,7 @@ pub fn handle_intro_selection(app_state: &mut AppState, index: usize) { // Add i
app_state.ui.show_intro = false;
app_state.ui.show_register = true;
app_state.ui.focus_outside_canvas = false;
app_state.button_focus_index = 0;
app_state.focused_button_index = 0;
}
_ => {}
}