Implement new GC API & rename to zipUtils

This commit is contained in:
KingRainbow44
2022-05-22 23:32:31 -04:00
parent 3554c98339
commit 8383fcfd1f
6 changed files with 15 additions and 7 deletions

15
src/utils/zipUtils.ts Normal file
View File

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