From 63b4da5be8faeaca4b2b7f87c6f4105ed9d21bf5 Mon Sep 17 00:00:00 2001 From: 4nshuman Date: Sun, 20 Oct 2024 02:07:07 +0530 Subject: [PATCH] connected upload's inbuilt progress counter --- src/gui/src/helpers.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/gui/src/helpers.js b/src/gui/src/helpers.js index dbbd5a11b..99309769f 100644 --- a/src/gui/src/helpers.js +++ b/src/gui/src/helpers.js @@ -2223,15 +2223,24 @@ window.unzipItem = async function(itemPath) { rootdir.path + '/', // options { - createFileParent: true + createFileParent: true, + progress: async function(operation_id, op_progress){ + progwin.set_progress(op_progress); + // update title if window is not visible + if(document.visibilityState !== "visible"){ + update_title_based_on_uploads(); + } + }, + success: async function(items){ + progwin?.set_progress(window.zippingProgressConfig.TOTAL.toPrecision(2)); + // close progress window + clearTimeout(progwin_timeout); + setTimeout(() => { + progwin?.close(); + }, Math.max(0, window.unzip_progress_hide_delay - (Date.now() - start_ts))); + } } ); - progwin?.set_progress(window.zippingProgressConfig.TOTAL.toPrecision(2)); - // close progress window - clearTimeout(progwin_timeout); - setTimeout(() => { - progwin?.close(); - }, Math.max(0, window.unzip_progress_hide_delay - (Date.now() - start_ts))); } }); }