From f79b1d227951e7b463b6d82fe87a6685a30ae22d Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 18 Mar 2023 17:26:22 +0800 Subject: [PATCH] :art: save to download_dir --- src-tauri/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 27f81bc..14eb67b 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -26,7 +26,7 @@ use wry::application::window::Icon; #[cfg(any(target_os = "linux", target_os = "windows"))] use wry::webview::WebContext; -use dirs::desktop_dir; +use dirs::download_dir; use std::path::PathBuf; enum UserEvent { @@ -147,7 +147,7 @@ fn main() -> wry::Result<()> { let download_started = { let proxy = proxy.clone(); move |uri: String, default_path: &mut PathBuf| { - let path = desktop_dir() + let path = download_dir() .unwrap() .join(default_path.display().to_string()) .as_path() @@ -243,7 +243,7 @@ fn main() -> wry::Result<()> { Event::UserEvent(UserEvent::DownloadComplete(_, success)) => { println!("Succeeded: {success}"); if success { - let _ = webview.evaluate_script("window.pakeToast('Downloaded to Desktop~')"); + let _ = webview.evaluate_script("window.pakeToast('Downloaded to download folder~')"); } else { println!("No output path") }