use crate::app::{actions::Action, state::AppState};
pub fn handle_reset(state: &mut AppState, action: &Action) -> bool {
match action {
Action::RequestResetHard => {
state.reset_pending = Some("--hard".into());
state.feedback_message = Some("Confirm hard reset: press again to execute (Esc to cancel)".into());
true
}
Action::RequestResetMixed => {
state.reset_pending = Some("--mixed".into());
state.feedback_message = Some("Confirm mixed reset: press again to execute (Esc to cancel)".into());
true
}
Action::RequestResetSoft => {
state.reset_pending = Some("--soft".into());
state.feedback_message = Some("Confirm soft reset: press again to execute (Esc to cancel)".into());
true
}
Action::ResetHard | Action::ResetMixed | Action::ResetSoft => {
state.reset_pending = None;
state.feedback_message = None;
true
}
Action::CancelReset => {
state.reset_pending = None;
state.feedback_message = None;
true
}
_ => false,
}
}