From 58932a6806f726b2337c94166d80b567d3d7f208 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 28 Jul 2016 17:13:05 -0700 Subject: [PATCH] Add reset of progress bar when domain changes --- scripts/system/progress.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/system/progress.js b/scripts/system/progress.js index dcd52bce98..660dfc4b98 100644 --- a/scripts/system/progress.js +++ b/scripts/system/progress.js @@ -96,6 +96,15 @@ visible: visible }); } + function resetProgress() { + wasActive = true; + bestRawProgress = 0; + rawProgress = 0; + cooldown = 1000; + displayProgress = 0; + } + + Window.domainChanged.connect(resetProgress); var maxSeen = 0; var bestRawProgress = 0; @@ -113,12 +122,8 @@ } else { var count = info.downloading.length + info.pending; if (!wasActive) { - wasActive = true; + resetProgress(); maxSeen = count; - bestRawProgress = 0; - rawProgress = 0; - cooldown = 2000; - displayProgress = 0; } if (count > maxSeen) { maxSeen = count; @@ -242,7 +247,7 @@ if (diff < 0.1) { displayProgress = rawProgress; } else { - displayProgress += diff * 0.2; + displayProgress += diff * 0.1; } } print('PROGRESS:', displayProgress);