renaming and extraction display

This commit is contained in:
SpikeHD
2022-05-15 21:32:20 -07:00
parent f8af7caaff
commit 167e13c941
7 changed files with 64 additions and 11 deletions

View File

@@ -144,6 +144,7 @@ export default class DownloadHandler {
return {
average: (progress / total) * 100 || 0,
files: this.downloads.filter(d => d.status === 'downloading').length,
extracting: this.downloads.filter(d => d.status === 'extracting').length,
totalSize: total,
speed: speedStr
}

View File

@@ -1,8 +1,15 @@
import { invoke } from '@tauri-apps/api'
import { listen } from '@tauri-apps/api/event'
export function unzip(file: string, dest: string) {
export function unzip(file: string, dest: string, onFinish?: () => void) {
invoke('unzip', {
zipfile: file,
destpath: dest,
})
listen('extract_end', ({payload}) => {
if (payload === file && onFinish) {
onFinish()
}
})
}