Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

handle reopen event

Brendan Allan42ab74466185
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index bba2b6166..d6f22c902 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -2230,8 +2230,16 @@ pub fn run() {
}
}
})
- .run(tauri::generate_context!())
- .expect("error while running tauri application");
+ .build(tauri::generate_context!())
+ .expect("error while running tauri application")
+ .run(|handle, event| match event {
+ #[cfg(target_os = "macos")]
+ tauri::RunEvent::Reopen {
+ has_visible_windows,
+ ..
+ } => open_main_window(handle.clone()),
+ _ => {}
+ });
}
type EditorInstancesState = Arc<Mutex<HashMap<String, Arc<EditorInstance>>>>;