HARDEST COMMIT IN THE RECENT TIMES we fixed movement in the admin page
This commit is contained in:
@@ -409,30 +409,6 @@ impl EventHandler {
|
||||
if state.handle_movement(app_state, ma) {
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
} else {
|
||||
// Non-admin: simple profile navigation
|
||||
match ma {
|
||||
MovementAction::Up | MovementAction::Previous => {
|
||||
state.previous();
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
MovementAction::Down | MovementAction::Next => {
|
||||
state.next();
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
MovementAction::Select => {
|
||||
if let Some(idx) = state.get_selected_index() {
|
||||
if let Some(profile) = app_state.profile_tree.profiles.get(idx) {
|
||||
app_state.selected_profile = Some(profile.name.clone());
|
||||
return Ok(EventOutcome::Ok(format!(
|
||||
"Profile '{}' selected",
|
||||
profile.name
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Page::Intro(state) => {
|
||||
@@ -458,29 +434,6 @@ impl EventHandler {
|
||||
) {
|
||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||
}
|
||||
} else {
|
||||
// Non-admin: allow simple profile navigation
|
||||
if let Some(action) = config.get_general_action(key_event.code, key_event.modifiers) {
|
||||
match action {
|
||||
"move_up" => {
|
||||
admin_state.previous();
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"move_down" => {
|
||||
admin_state.next();
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"select" => {
|
||||
if let Some(idx) = admin_state.get_selected_index() {
|
||||
if let Some(profile) = app_state.profile_tree.profiles.get(idx) {
|
||||
app_state.selected_profile = Some(profile.name.clone());
|
||||
}
|
||||
}
|
||||
return Ok(EventOutcome::Ok("Profile selected".to_string()));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user