ui: save mnemonic phrase word on enter key press, remove useless separate function to check back press event

This commit is contained in:
ardocrat
2023-07-23 17:21:02 +03:00
parent 2f5011c36f
commit c166f21d1e
3 changed files with 17 additions and 10 deletions
+1 -8
View File
@@ -43,7 +43,7 @@ impl<Platform> PlatformApp<Platform> {
impl<Platform: PlatformCallbacks> eframe::App for PlatformApp<Platform> {
fn update(&mut self, ctx: &Context, frame: &mut eframe::Frame) {
// Handle Esc keyboard key event and platform Back button key event.
let back_button_pressed = back_button_pressed();
let back_button_pressed = BACK_BUTTON_PRESSED.load(Ordering::Relaxed);
if ctx.input(|i| i.key_pressed(egui::Key::Escape) || back_button_pressed) {
if back_button_pressed {
BACK_BUTTON_PRESSED.store(false, Ordering::Relaxed);
@@ -70,13 +70,6 @@ impl<Platform: PlatformCallbacks> eframe::App for PlatformApp<Platform> {
}
}
/// Check if platform Back button was pressed.
fn back_button_pressed() -> bool {
BACK_BUTTON_PRESSED.load(Ordering::Relaxed)
}
#[allow(dead_code)]
#[cfg(target_os = "android")]
#[allow(non_snake_case)]