Skip to content

Commit

Permalink
fix: esc key bug when playing bot (#129)
Browse files Browse the repository at this point in the history
* fix: esc key bug when playing bot

Signed-off-by: Thomas Mauran <[email protected]>

* chore: fix lint

Signed-off-by: Thomas Mauran <[email protected]>

---------

Signed-off-by: Thomas Mauran <[email protected]>
  • Loading branch information
thomas-mauran authored Feb 3, 2025
1 parent f8cec51 commit ee99321
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,8 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> {
_ => {}
}

match app.current_page {
Pages::Bot => {
app.current_page = Pages::Home;
app.menu_cursor = 0;
app.selected_color = None;
}
Pages::Credit => {
app.current_page = Pages::Home;
}
_ => {}
if app.current_page == Pages::Credit {
app.current_page = Pages::Home;
}

app.game.ui.unselect_cell();
Expand Down

0 comments on commit ee99321

Please sign in to comment.