mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-17 01:24:36 +01:00
renaming and extraction display
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user