(
app: tauri::AppHandle,
startup_trace: State<'_, DesktopStartupTrace>,
)
| 441 | /// dialog when the user chooses to minimize instead of quitting). |
| 442 | #[tauri::command] |
| 443 | pub async fn minimize_to_tray( |
| 444 | app: tauri::AppHandle, |
| 445 | startup_trace: State<'_, DesktopStartupTrace>, |
| 446 | ) -> Result<(), String> { |
| 447 | if let Err(error) = crate::tray::setup_tray(&app, &startup_trace) { |
| 448 | log::warn!("Failed to initialize tray before minimizing: {}", error); |
| 449 | } |
| 450 | if let Some(window) = app.get_webview_window("main") { |
| 451 | window.hide().map_err(|e| e.to_string())?; |
| 452 | log::info!("Main window minimized to tray via command"); |
| 453 | } |
| 454 | Ok(()) |
| 455 | } |
| 456 | |
| 457 | /// Initialize the desktop tray after the startup shell has become interactive. |
| 458 | #[tauri::command] |
nothing calls this directly
no test coverage detected