fix transfert
This commit is contained in:
		| @@ -407,13 +407,11 @@ export default { | |||||||
|                 try { |                 try { | ||||||
|                     this.isTransfering = true; |                     this.isTransfering = true; | ||||||
|                     const file = this.file; |                     const file = this.file; | ||||||
|  |                     if (!file) return; | ||||||
|  |  | ||||||
|                     if (file.isList) { |                     if (file.isList) { | ||||||
|                         await this.moveListOfFiles(file); |                         await this.moveListOfFiles(file); | ||||||
|                         return; |                     } else { | ||||||
|                     } |  | ||||||
|  |  | ||||||
|                     if (!file) return; |  | ||||||
|                         if (file.isDirectory) { |                         if (file.isDirectory) { | ||||||
|                             await this.moveFilesOfFolder(file, ''); |                             await this.moveFilesOfFolder(file, ''); | ||||||
|                         } else { |                         } else { | ||||||
| @@ -425,6 +423,7 @@ export default { | |||||||
|                             await this.moveFileToTarget(file, ''); |                             await this.moveFileToTarget(file, ''); | ||||||
|                             this.transferProgress = 100; |                             this.transferProgress = 100; | ||||||
|                         } |                         } | ||||||
|  |                     } | ||||||
|                    |                    | ||||||
|                     this.isTransfering = false; |                     this.isTransfering = false; | ||||||
|                     this.transferProgress = 0; |                     this.transferProgress = 0; | ||||||
| @@ -443,14 +442,15 @@ export default { | |||||||
|             this.isDroppable = true; |             this.isDroppable = true; | ||||||
|         }, |         }, | ||||||
|         async moveListOfFiles(files) { |         async moveListOfFiles(files) { | ||||||
|             for (const file of files) { |             for (const file of files.children) { | ||||||
|                 if (file.isDirectory) { |                 if (file.isDirectory) { | ||||||
|                     await this.moveFilesOfFolder(file, ''); |                     //just create the folder | ||||||
|  |                     await this.createFolder(file, file.parentPath + '/'); | ||||||
|                 } else { |                 } else { | ||||||
|                     if (file.content && typeof file.content.arrayBuffer === 'function') { |                     if (file.content && typeof file.content.arrayBuffer === 'function') { | ||||||
|                         file.content = await file.content.arrayBuffer(); |                         file.content = await file.content.arrayBuffer(); | ||||||
|                     } |                     } | ||||||
|                     await this.moveFileToTarget(file, ''); |                     await this.moveFileToTarget(file, file.parentPath + '/'); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|   | |||||||
| @@ -72,7 +72,6 @@ | |||||||
|                         {{ formatFileSize(file.size) }} |                         {{ formatFileSize(file.size) }} | ||||||
|                     </div> |                     </div> | ||||||
|                 </div> |                 </div> | ||||||
|  |  | ||||||
|             </div> |             </div> | ||||||
|         </div> |         </div> | ||||||
|         <div v-if="isLoading" class="flex h-full items-center justify-center"> |         <div v-if="isLoading" class="flex h-full items-center justify-center"> | ||||||
| @@ -333,9 +332,7 @@ export default { | |||||||
|                     unzip: Promise.all(this.cochedFiles.map(file => file.unzip)) |                     unzip: Promise.all(this.cochedFiles.map(file => file.unzip)) | ||||||
|                 }; |                 }; | ||||||
|                 try { |                 try { | ||||||
|                     const files = getFilesFromFolder(folder); |                     await folder.unzip; | ||||||
|                     const filesToUnzip = files.map(file => file.unzip); |  | ||||||
|                     await Promise.all(filesToUnzip); |  | ||||||
|                     this.$emit('file-upload', folder); |                     this.$emit('file-upload', folder); | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     console.error('Erreur lors du drag start :', error); |                     console.error('Erreur lors du drag start :', error); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user