Fixing wait for F2 bug when it swiched to HandOff state from Error state.

This commit is contained in:
2026-06-24 19:02:26 +02:00
parent 75c043b652
commit ab7ba83428
+7 -2
View File
@@ -241,7 +241,6 @@ impl NyanitTUI<'_> {
frame.render_widget(ok_text, vertical_chunks[1]); frame.render_widget(ok_text, vertical_chunks[1]);
// just some time to look at message // just some time to look at message
thread::sleep(Duration::from_millis(1000)) thread::sleep(Duration::from_millis(1000))
} }
_ => (), _ => (),
}; };
@@ -285,7 +284,10 @@ impl NyanitTUI<'_> {
if unlocked { if unlocked {
// need to check for subvolumes and stuff // need to check for subvolumes and stuff
self.state = match mount_and_check_snaps() { self.state = match mount_and_check_snaps() {
Ok(st) => st, Ok(st) => {
self.time_counter = 0;
st
}
Err(ex) => NyanitState::Error(ex.to_string()), Err(ex) => NyanitState::Error(ex.to_string()),
} }
} }
@@ -321,6 +323,8 @@ impl NyanitTUI<'_> {
} else { } else {
// Tick time // Tick time
thread::sleep(Duration::from_millis(500)); thread::sleep(Duration::from_millis(500));
if let NyanitState::WaitForF2(_) = self.state {
self.time_counter = self.time_counter.wrapping_add(1u32); self.time_counter = self.time_counter.wrapping_add(1u32);
// 2.5 sec wait // 2.5 sec wait
if self.time_counter > 5 { if self.time_counter > 5 {
@@ -328,6 +332,7 @@ impl NyanitTUI<'_> {
self.state = NyanitState::HandOff(TMP_ROOT.into()); self.state = NyanitState::HandOff(TMP_ROOT.into());
} }
} }
}
Ok(()) Ok(())
} }
} }