Skip to content

Commit

Permalink
fix: build error in windows and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
reyamir committed Mar 6, 2024
1 parent 0e1e752 commit 25d0730
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>()
.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::<Vec<_>>()
.join(",");
let _ = w.eval(&format!("window.onFileOpen(`{urls}`)"));
}
}
}
});
},
);
}

0 comments on commit 25d0730

Please sign in to comment.