diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index e3b54913..752ea184 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -120,16 +120,20 @@ fn main() { ]) .build(tauri::generate_context!()) .expect("error while running tauri application") - .run(|app, event| { - if let tauri::RunEvent::Opened { urls } = event { - if let Some(w) = app.get_webview_window("main") { - let urls = urls - .iter() - .map(|u| u.as_str()) - .collect::>() - .join(","); - let _ = w.eval(&format!("window.onFileOpen(`{urls}`)")); + .run( + #[allow(unused_variables)] + |app, event| { + #[cfg(any(target_os = "macos"))] + if let tauri::RunEvent::Opened { urls } = event { + if let Some(w) = app.get_webview_window("main") { + let urls = urls + .iter() + .map(|u| u.as_str()) + .collect::>() + .join(","); + let _ = w.eval(&format!("window.onFileOpen(`{urls}`)")); + } } - } - }); + }, + ); }