From 4601ba409465ac9c8dd44f7a6bd367c2c4af488c Mon Sep 17 00:00:00 2001 From: filipriec Date: Wed, 26 Mar 2025 00:43:42 +0100 Subject: [PATCH] unused stuff removed --- client/src/modes/general/navigation.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/client/src/modes/general/navigation.rs b/client/src/modes/general/navigation.rs index 9628e26..14888bb 100644 --- a/client/src/modes/general/navigation.rs +++ b/client/src/modes/general/navigation.rs @@ -22,16 +22,11 @@ pub async fn handle_navigation_event( return Ok((false, String::new())); } "move_down" => { - let item_count = if app_state.ui.show_intro { - 2 // Intro options count - } else { - app_state.profile_tree.profiles.len() // Admin panel items - }; - move_down(app_state, item_count); + move_down(app_state); return Ok((false, String::new())); } "next_option" => { - next_option(app_state, 2); // Intro has 2 options + next_option(app_state); // Intro has 2 options return Ok((false, String::new())); } "previous_option" => { @@ -85,7 +80,7 @@ pub fn move_up(app_state: &mut AppState) { } } -pub fn move_down(app_state: &mut AppState, item_count: usize) { +pub fn move_down(app_state: &mut AppState) { if app_state.ui.show_intro { app_state.ui.intro_state.next_option(); } else if app_state.ui.show_admin { @@ -99,11 +94,12 @@ pub fn move_down(app_state: &mut AppState, item_count: usize) { } } -pub fn next_option(app_state: &mut AppState, option_count: usize) { +pub fn next_option(app_state: &mut AppState) { // Remove option_count parameter if app_state.ui.show_intro { app_state.ui.intro_state.next_option(); } else { - // For other screens that might have options + // Get option count from state instead of parameter + let option_count = app_state.profile_tree.profiles.len(); app_state.general.current_option = (app_state.general.current_option + 1) % option_count; } }