From ee99321250298254dca856f2a51b640dd08df7d9 Mon Sep 17 00:00:00 2001 From: Thomas Mauran <78204354+thomas-mauran@users.noreply.github.com> Date: Mon, 3 Feb 2025 21:07:54 +0100 Subject: [PATCH] fix: esc key bug when playing bot (#129) * fix: esc key bug when playing bot Signed-off-by: Thomas Mauran * chore: fix lint Signed-off-by: Thomas Mauran --------- Signed-off-by: Thomas Mauran --- src/handler.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index b61db8a..abcfbf7 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -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();