@@ -5,9 +5,9 @@ import FileItem from './components/FileItem.vue';
5
5
import { useFileDataStore } from ' ./stores/fileData' ;
6
6
import { storeToRefs } from ' pinia' ;
7
7
import type { FileObj } from ' ./types/file' ;
8
- import { computed , ref , watch } from ' vue' ;
8
+ import { computed , ref } from ' vue' ;
9
9
import { compressFile } from ' ./functions/imageCompression' ;
10
- import { comressToZip } from ' ./functions/zipCompression' ;
10
+ import { compressToZip } from ' ./functions/zipCompression' ;
11
11
import { paginate } from ' ./functions/paginate' ;
12
12
import { useI18n } from ' ./hooks/useI18n' ;
13
13
@@ -46,19 +46,15 @@ async function compressFiles() {
46
46
}
47
47
48
48
isCompressing .value = false ;
49
+
50
+ isZipCompressing .value = true ;
51
+ zipData .value = await compressToZip ();
52
+ isZipCompressing .value = false ;
49
53
}
50
54
51
55
function removeItem(file : FileObj ) {
52
56
files .value = files .value .filter ((item ) => item !== file );
53
57
}
54
-
55
- watch (anyUncompressed , async (newVal ) => {
56
- if (files .value .length && ! newVal ) {
57
- isZipCompressing .value = true ;
58
- zipData .value = await comressToZip ();
59
- isZipCompressing .value = false ;
60
- }
61
- });
62
58
</script >
63
59
64
60
<template >
@@ -93,7 +89,7 @@ watch(anyUncompressed, async (newVal) => {
93
89
</button >
94
90
<a
95
91
:aria-busy =" isZipCompressing"
96
- :aria- disabled =" !zipData"
92
+ :disabled =" !zipData || undefined "
97
93
:href =" zipData || undefined"
98
94
role =" button"
99
95
download
0 commit comments