From 82bd751ac896a17120142bde895c5554a01234dc Mon Sep 17 00:00:00 2001 From: antifallobst Date: Thu, 29 Jun 2023 13:30:45 +0200 Subject: [PATCH] fix (UI): fixed a bug that caused a panic when cancelling a login process. --- src/ui/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 2955717..06d3270 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -259,7 +259,7 @@ impl UI { })?; match Input::from(read()?.clone()) { - Input { key: Key::Esc, .. } => break, + Input { key: Key::Esc, .. } => return Err(Error::msg("Login cancelled by user")), Input { key: Key::Enter, .. @@ -311,7 +311,6 @@ impl UI { } }; } - Ok(()) } pub fn close(&mut self) -> Result<()>{