show dialog

This commit is contained in:
Lucas Nogueira
2026-03-04 14:02:14 -03:00
parent ec9e4e8fb1
commit a9525cfadf

View File

@@ -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
}