@@ -6,8 +6,8 @@ import { useFileDataStore } from './stores/fileData';
6
6
import { storeToRefs } from ' pinia' ;
7
7
import type { FileObj } from ' ./types/file' ;
8
8
import { computed , ref , watch } from ' vue' ;
9
- import { useImageCompression } from ' ./composables/useImageCompression ' ;
10
- import { useZipCompression } from ' ./composables/useZipCompression ' ;
9
+ import { compressFile } from ' ./functions/imageCompression ' ;
10
+ import { comressToZip } from ' ./functions/zipCompression ' ;
11
11
import { useI18n } from ' ./hooks/useI18n' ;
12
12
13
13
const { t } = useI18n ();
@@ -22,7 +22,7 @@ const anyUncompressed = computed(() => files.value.some((file) => !file.isCompre
22
22
23
23
async function editFileObj(fileObj : FileObj ) {
24
24
try {
25
- const compressedFile = await useImageCompression (fileObj .file );
25
+ const compressedFile = await compressFile (fileObj .file );
26
26
const item = files .value .find ((item ) => item .id === fileObj .id );
27
27
if (! item ) return ;
28
28
item .file = compressedFile ;
@@ -50,7 +50,7 @@ function removeItem(file: FileObj) {
50
50
watch (anyUncompressed , async (newVal ) => {
51
51
if (files .value .length && ! newVal ) {
52
52
isZipCompressing .value = true ;
53
- zipData .value = await useZipCompression ();
53
+ zipData .value = await comressToZip ();
54
54
isZipCompressing .value = false ;
55
55
}
56
56
});
0 commit comments