fixing more errors, last to go
This commit is contained in:
@@ -7,6 +7,7 @@ use crate::state::pages::form::FormState;
|
||||
use crate::state::pages::auth::AuthState;
|
||||
use crate::state::canvas_state::CanvasState;
|
||||
use crate::tui::functions::{intro, admin};
|
||||
use crate::modes::handlers::event::EventOutcome;
|
||||
|
||||
pub async fn handle_navigation_event(
|
||||
key: KeyEvent,
|
||||
@@ -17,51 +18,51 @@ pub async fn handle_navigation_event(
|
||||
command_mode: &mut bool,
|
||||
command_input: &mut String,
|
||||
command_message: &mut String,
|
||||
) -> Result<(bool, String), Box<dyn std::error::Error>> {
|
||||
) -> Result<EventOutcome, Box<dyn std::error::Error>> {
|
||||
if let Some(action) = config.get_general_action(key.code, key.modifiers) {
|
||||
match action {
|
||||
"move_up" => {
|
||||
move_up(app_state, auth_state);
|
||||
return Ok((false, String::new()));
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"move_down" => {
|
||||
move_down(app_state);
|
||||
return Ok((false, String::new()));
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"next_option" => {
|
||||
next_option(app_state); // Intro has 2 options
|
||||
return Ok((false, String::new()));
|
||||
next_option(app_state);
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"previous_option" => {
|
||||
previous_option(app_state);
|
||||
return Ok((false, String::new()));
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"select" => {
|
||||
select(app_state);
|
||||
return Ok((false, "Selected".to_string()));
|
||||
return Ok(EventOutcome::Ok("Selected".to_string()));
|
||||
}
|
||||
"toggle_sidebar" => {
|
||||
toggle_sidebar(app_state);
|
||||
return Ok((false, format!("Sidebar {}",
|
||||
return Ok(EventOutcome::Ok(format!("Sidebar {}",
|
||||
if app_state.ui.show_sidebar { "shown" } else { "hidden" }
|
||||
)));
|
||||
}
|
||||
"next_field" => {
|
||||
next_field(form_state);
|
||||
return Ok((false, String::new()));
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"prev_field" => {
|
||||
prev_field(form_state);
|
||||
return Ok((false, String::new()));
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
"enter_command_mode" => {
|
||||
handle_enter_command_mode(command_mode, command_input, command_message);
|
||||
return Ok((false, String::new()));
|
||||
return Ok(EventOutcome::Ok(String::new()));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
Ok((false, String::new()))
|
||||
Ok(EventOutcome::Ok(String::new()))
|
||||
}
|
||||
|
||||
pub fn move_up(app_state: &mut AppState, auth_state: &mut AuthState) {
|
||||
|
||||
Reference in New Issue
Block a user