Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
refactor(desktop): extract handle_exit_requested exit decision helper
Richie McIlroy30e6a305d3d1
diff --git a/apps/desktop/src-tauri/src/exit_shutdown.rs b/apps/desktop/src-tauri/src/exit_shutdown.rsindex 24736b6f1..2fcd4639c 100644--- a/apps/desktop/src-tauri/src/exit_shutdown.rs+++ b/apps/desktop/src-tauri/src/exit_shutdown.rs@@ -79,6 +79,37 @@ pub(crate) fn app_exit_action(exit_code: i32) -> AppExitAction {}}+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub(crate) enum ExitRequestDecision {+ StartCleanup,+ AlreadyExiting,+ ExportActive,+ AllowRuntimeExit,+}++pub(crate) fn handle_exit_requested<FPrevent>(+ is_exiting: bool,+ export_active: bool,+ runtime_exit_requested: bool,+ prevent_exit: FPrevent,+) -> ExitRequestDecision+where+ FPrevent: FnOnce(),+{+ if export_active {+ prevent_exit();+ ExitRequestDecision::ExportActive+ } else if is_exiting && runtime_exit_requested {+ ExitRequestDecision::AllowRuntimeExit+ } else if is_exiting {+ prevent_exit();+ ExitRequestDecision::AlreadyExiting+ } else {+ prevent_exit();+ ExitRequestDecision::StartCleanup+ }+}+pub(crate) fn read_target_under_cursor<TDisplay, TWindow, FExit, FDisplay, FWindow>(is_exiting: FExit,display: FDisplay,