From ab7ba834282705aca883496f9914ceef0b24c517ffd12a2cd4967599418dd88c Mon Sep 17 00:00:00 2001 From: Kira Date: Wed, 24 Jun 2026 19:02:26 +0200 Subject: [PATCH] Fixing wait for F2 bug when it swiched to HandOff state from Error state. --- src/main.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index b90153d..40438af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -241,7 +241,6 @@ impl NyanitTUI<'_> { frame.render_widget(ok_text, vertical_chunks[1]); // just some time to look at message thread::sleep(Duration::from_millis(1000)) - } _ => (), }; @@ -285,7 +284,10 @@ impl NyanitTUI<'_> { if unlocked { // need to check for subvolumes and stuff self.state = match mount_and_check_snaps() { - Ok(st) => st, + Ok(st) => { + self.time_counter = 0; + st + } Err(ex) => NyanitState::Error(ex.to_string()), } } @@ -321,11 +323,14 @@ impl NyanitTUI<'_> { } else { // Tick time thread::sleep(Duration::from_millis(500)); - self.time_counter = self.time_counter.wrapping_add(1u32); - // 2.5 sec wait - if self.time_counter > 5 { - // boot from root - self.state = NyanitState::HandOff(TMP_ROOT.into()); + + if let NyanitState::WaitForF2(_) = self.state { + self.time_counter = self.time_counter.wrapping_add(1u32); + // 2.5 sec wait + if self.time_counter > 5 { + // boot from root + self.state = NyanitState::HandOff(TMP_ROOT.into()); + } } } Ok(())