1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-11-03 00:54:44 +00:00

progress bar: fix initial delayed update

when the displayed frontend state changes, any progress bar
should begin in the initial correct state before smoothly
transitioning with time.
This commit is contained in:
Oliver Giles
2020-11-20 14:08:02 +13:00
parent 3e993d35a0
commit b851c72d53
2 changed files with 4 additions and 2 deletions

View File

@@ -123,7 +123,10 @@ Vue.mixin({
// - the current job has started (practically hard to reach)
clearInterval(this.updateTimer);
if (val.length) {
// TODO: first, a non-animated progress update
// set the current progress update first
this.jobsRunning.forEach(this.updateProgress);
this.$forceUpdate();
// then update with animation every second
this.updateTimer = setInterval(() => {
this.jobsRunning.forEach(this.updateProgress);
this.$forceUpdate();