This commit is contained in:
parent
ae049b7966
commit
95a50531da
2 changed files with 22 additions and 7 deletions
|
@ -42,9 +42,8 @@ const uploadFiles = async () => {
|
|||
);
|
||||
});
|
||||
|
||||
await Promise.all(uploadPromises);
|
||||
|
||||
uploadingFilesNow.value = false;
|
||||
await Promise.all(uploadPromises)
|
||||
//uploadingFilesNow.value = false;
|
||||
};
|
||||
|
||||
const checkUploadStatus = async (file) => {
|
||||
|
@ -55,8 +54,7 @@ const checkUploadStatus = async (file) => {
|
|||
}).then(response => {
|
||||
if (response.status === 200) {
|
||||
if (response.data.import_status === 1) {
|
||||
//checkUploadStatus(id)
|
||||
console.log('test')
|
||||
|
||||
} else {
|
||||
file.uploadingNow = false
|
||||
clearInterval(file.checkAnalyzer);
|
||||
|
@ -65,6 +63,13 @@ const checkUploadStatus = async (file) => {
|
|||
})
|
||||
}
|
||||
|
||||
watch(selectedFilesMetadata, (newValue, oldValue) => {
|
||||
const notUploading = newValue.every(data => data.uploadingNow)
|
||||
console.log(newValue)
|
||||
if (!notUploading) {
|
||||
uploadingFilesNow.value = false;
|
||||
}
|
||||
}, {deep: true})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -113,12 +118,20 @@ const checkUploadStatus = async (file) => {
|
|||
<v-btn
|
||||
color="primary"
|
||||
size="large"
|
||||
variant="flat"
|
||||
type="submit"
|
||||
variant="elevated"
|
||||
:disabled="selectedFiles.length === 0 || uploadingFilesNow"
|
||||
:loading="uploadingFilesNow"
|
||||
:disabled="selectedFiles.length === 0"
|
||||
@click="uploadFiles"
|
||||
>Carica
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="secondary"
|
||||
size="large"
|
||||
variant="flat"
|
||||
:disabled="uploadingFilesNow"
|
||||
@click="$emit('confirm',false)"
|
||||
>Chiudi</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue