fix: build error in windows and linux
This commit is contained in:
@@ -120,16 +120,20 @@ fn main() {
|
|||||||
])
|
])
|
||||||
.build(tauri::generate_context!())
|
.build(tauri::generate_context!())
|
||||||
.expect("error while running tauri application")
|
.expect("error while running tauri application")
|
||||||
.run(|app, event| {
|
.run(
|
||||||
if let tauri::RunEvent::Opened { urls } = event {
|
#[allow(unused_variables)]
|
||||||
if let Some(w) = app.get_webview_window("main") {
|
|app, event| {
|
||||||
let urls = urls
|
#[cfg(any(target_os = "macos"))]
|
||||||
.iter()
|
if let tauri::RunEvent::Opened { urls } = event {
|
||||||
.map(|u| u.as_str())
|
if let Some(w) = app.get_webview_window("main") {
|
||||||
.collect::<Vec<_>>()
|
let urls = urls
|
||||||
.join(",");
|
.iter()
|
||||||
let _ = w.eval(&format!("window.onFileOpen(`{urls}`)"));
|
.map(|u| u.as_str())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(",");
|
||||||
|
let _ = w.eval(&format!("window.onFileOpen(`{urls}`)"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user