mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
show dialog
This commit is contained in:
@@ -726,7 +726,7 @@ wrap_download_handler! {
|
||||
.map(std::path::PathBuf::from)
|
||||
.unwrap_or_default();
|
||||
|
||||
let mut destination = suggested_path;
|
||||
let mut destination = suggested_path.clone();
|
||||
|
||||
// Call handler with Requested event
|
||||
let should_allow = (self.download_handler)(tauri_runtime::webview::DownloadEvent::Requested {
|
||||
@@ -737,7 +737,10 @@ wrap_download_handler! {
|
||||
if should_allow {
|
||||
// Set the download path
|
||||
let destination_cef = CefStringUtf16::from(destination.to_string_lossy().as_ref());
|
||||
callback.cont(Some(&destination_cef), 0);
|
||||
|
||||
// if the user callback did not modify the destination, show the dialog
|
||||
let show_dialog = destination == suggested_path;
|
||||
callback.cont(Some(&destination_cef), show_dialog as ::std::os::raw::c_int);
|
||||
}
|
||||
1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user