HARDEST COMMIT IN THE RECENT TIMES we fixed movement in the admin page
This commit is contained in:
@@ -28,12 +28,12 @@ pub async fn handle_navigation_event(
|
||||
|
||||
if let Some(action) = config.get_general_action(key.code, key.modifiers) {
|
||||
match action {
|
||||
"move_up" => {
|
||||
move_up(app_state, router);
|
||||
"up" => {
|
||||
up(app_state, router);
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"move_down" => {
|
||||
move_down(app_state, router);
|
||||
"down" => {
|
||||
down(app_state, router);
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"next_option" => {
|
||||
@@ -85,7 +85,7 @@ pub async fn handle_navigation_event(
|
||||
Ok(EventOutcome::Ok(String::new()))
|
||||
}
|
||||
|
||||
pub fn move_up(app_state: &mut AppState, router: &mut Router) {
|
||||
pub fn up(app_state: &mut AppState, router: &mut Router) {
|
||||
match &mut router.current {
|
||||
Page::Login(state) if app_state.ui.focus_outside_canvas => {
|
||||
if app_state.focused_button_index == 0 {
|
||||
@@ -113,7 +113,7 @@ pub fn move_up(app_state: &mut AppState, router: &mut Router) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn move_down(app_state: &mut AppState, router: &mut Router) {
|
||||
pub fn down(app_state: &mut AppState, router: &mut Router) {
|
||||
match &mut router.current {
|
||||
Page::Login(_) | Page::Register(_) if app_state.ui.focus_outside_canvas => {
|
||||
let num_general_elements = 2;
|
||||
|
||||
Reference in New Issue
Block a user