gamechanging, commands works only on their windows properly well
This commit is contained in:
@@ -51,19 +51,16 @@ impl EventHandler {
|
||||
) -> Result<(bool, String), Box<dyn std::error::Error>> {
|
||||
if app_state.ui.show_intro {
|
||||
if let Event::Key(key) = event {
|
||||
match key.code {
|
||||
KeyCode::Left => intro_state.previous_option(),
|
||||
KeyCode::Right => intro_state.next_option(),
|
||||
KeyCode::Enter => {
|
||||
if intro_state.selected_option == 0 {
|
||||
app_state.ui.show_intro = false;
|
||||
} else {
|
||||
app_state.ui.show_intro = false;
|
||||
app_state.ui.show_admin = true;
|
||||
}
|
||||
return Ok((false, String::new()));
|
||||
}
|
||||
_ => {}
|
||||
let action = config.get_intro_action(key.code, key.modifiers);
|
||||
|
||||
match action {
|
||||
Some("previous_option") => intro_state.previous_option(),
|
||||
Some("next_option") => intro_state.next_option(),
|
||||
Some("select") => {
|
||||
app_state.ui.show_intro = false;
|
||||
app_state.ui.show_admin = intro_state.selected_option == 1;
|
||||
},
|
||||
_ => {} // Ignore all other keys
|
||||
}
|
||||
}
|
||||
return Ok((false, String::new()));
|
||||
|
||||
Reference in New Issue
Block a user