mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 23:24: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 {
|
.await {
|
||||||
Ok(r) => r,
|
Ok(r) => r,
|
||||||
Err(_e) => {
|
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));
|
return Err(format!("Failed to request {}", url));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -59,8 +59,12 @@ export default class DownloadHandler {
|
|||||||
error: string,
|
error: string,
|
||||||
} = payload
|
} = payload
|
||||||
|
|
||||||
|
console.log(payload)
|
||||||
|
|
||||||
// Set download to error
|
// Set download to error
|
||||||
const index = this.downloads.findIndex(download => download.path === errorData.path)
|
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].status = 'error'
|
||||||
this.downloads[index].error = errorData.error
|
this.downloads[index].error = errorData.error
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user