From 08721cbe9454fcd60faea60b5d53cbfbc7a58b41 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 4 Jun 2020 12:52:16 +0100 Subject: [PATCH] Fixed animated progress bar on app removal --- CHANGELOG.md | 1 + js/comms.js | 2 +- js/ui.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5910e49f..c4829a56f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,3 +22,4 @@ Changed for individual apps are listed in `apps/appname/ChangeLog` * App description can now be markdown * Fix `marked is not defined` error (and include in repo, just in case) * Fix error in 'Install Default Apps' if Flash storage is full enough that erasing takes a while +* Fixed animated progress bar on app removal diff --git a/js/comms.js b/js/comms.js index 2ef539144..4022514c3 100644 --- a/js/comms.js +++ b/js/comms.js @@ -146,7 +146,7 @@ const Comms = { }, removeAllApps : () => { console.log(" removeAllApps start"); - Progress.show({title:"Removing all apps",progess:"animate",sticky:true}); + Progress.show({title:"Removing all apps",percent:"animate",sticky:true}); return new Promise((resolve,reject) => { var timeout = 5; function handleResult(result,err) { diff --git a/js/ui.js b/js/ui.js index 50863b43f..718393236 100644 --- a/js/ui.js +++ b/js/ui.js @@ -4,7 +4,7 @@ const Progress = { domElement : null, // the DOM element sticky : false, // Progress.show({..., sticky:true}) don't remove until Progress.hide({sticky:true}) - interval : undefined, // the interval used if Progress.show({progress:"animate"}) + interval : undefined, // the interval used if Progress.show({percent:"animate"}) percent : undefined, // the current progress percentage min : 0, // scaling for percentage max : 1, // scaling for percentage @@ -30,13 +30,13 @@ const Progress = { clearInterval(Progress.interval); Progress.interval = undefined; } - if (percent == "animate") { + if (options.percent == "animate") { Progress.interval = setInterval(function() { Progress.percent += 2; if (Progress.percent>100) Progress.percent=0; Progress.show({percent:Progress.percent}); }, 100); - percent = 0; + Progress.percent = percent = 0; } let toastcontainer = document.getElementById("toastcontainer");