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
+12 -7
View File
@@ -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(())