2026-07-12 11:28:39 +07:00
|
|
|
//! Quit-confirm mode: the "are you sure?" overlay shown before exiting.
|
2026-07-11 18:23:01 +07:00
|
|
|
use crate::app::runtime::actions::Action;
|
|
|
|
|
|
2026-07-12 11:28:39 +07:00
|
|
|
/// Translate the user's yes/no answer on the quit-confirm overlay into an action.
|
|
|
|
|
///
|
|
|
|
|
/// Return: `Action::ForceQuit` if confirmed, otherwise `Action::CloseOverlay`
|
|
|
|
|
/// to dismiss the prompt without quitting.
|
2026-07-11 18:23:01 +07:00
|
|
|
pub fn handle_quit_confirm(yes: bool) -> Action {
|
|
|
|
|
if yes {
|
|
|
|
|
Action::ForceQuit
|
|
|
|
|
} else {
|
|
|
|
|
Action::CloseOverlay
|
|
|
|
|
}
|
|
|
|
|
}
|