From 192a6d4b0531716984b9b0b134c3f76ad1ab298f Mon Sep 17 00:00:00 2001 From: GMrrc <143954951+GMrrc@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:02:30 +0100 Subject: [PATCH] fix progressBar --- src/components/FileTable.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/FileTable.vue b/src/components/FileTable.vue index a4a7469..3861923 100644 --- a/src/components/FileTable.vue +++ b/src/components/FileTable.vue @@ -290,8 +290,17 @@ export default { async moveFilesOfFolder(folder, parentPath) { await this.createFolder(folder, parentPath); + const checkChildrenInChildren = (folder) => { + let total = folder.children.length; + for (const child of folder.children) { + if (child.isDirectory) { + total += checkChildrenInChildren(child); + } + } + return total; + }; - const progressSteps = 100 / folder.children.length; + const progressSteps = Math.floor(100 / checkChildrenInChildren(folder)); for (const child of folder.children) { this.transferProgress += progressSteps;