remove downloads frontend

This commit is contained in:
SpikeHD
2022-05-12 21:20:43 -07:00
parent f9f3461da5
commit 2bcb68ba32
3 changed files with 18 additions and 4 deletions

View File

@@ -69,6 +69,15 @@ export default class DownloadHandler {
this.downloads.push(obj)
}
stopDownload(path: string) {
// Stop download and remove from list.
invoke('stop_download', { path })
// Remove from list
const index = this.downloads.findIndex(download => download.path === path)
this.downloads.splice(index, 1)
}
getDownloadProgress(path: string) {
const index = this.downloads.findIndex(download => download.path === path)
return this.downloads[index] || null