mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 15:14:35 +01:00
fix download request errors
This commit is contained in:
@@ -24,7 +24,7 @@ pub async fn download_file(window: tauri::Window, url: &str, path: &str) -> Resu
|
||||
.await {
|
||||
Ok(r) => r,
|
||||
Err(_e) => {
|
||||
emit_download_err(window, format!("Failed to request {}", url), url);
|
||||
emit_download_err(window, format!("Failed to request {}", url), path);
|
||||
return Err(format!("Failed to request {}", url));
|
||||
},
|
||||
};
|
||||
|
||||
@@ -59,8 +59,12 @@ export default class DownloadHandler {
|
||||
error: string,
|
||||
} = payload
|
||||
|
||||
console.log(payload)
|
||||
|
||||
// Set download to error
|
||||
const index = this.downloads.findIndex(download => download.path === errorData.path)
|
||||
console.log(index)
|
||||
console.log(this.downloads[index])
|
||||
this.downloads[index].status = 'error'
|
||||
this.downloads[index].error = errorData.error
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user