fix download request errors

This commit is contained in:
SpikeHD
2022-05-16 19:20:03 -07:00
parent 0381af4a32
commit 8243222dd3
2 changed files with 5 additions and 1 deletions

View File

@@ -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));
},
};

View File

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