Skip to content

Commit

Permalink
fix loading flickering
Browse files Browse the repository at this point in the history
- [CORE-950]
  • Loading branch information
Tobias Winkler committed Feb 18, 2020
1 parent 3d2bbf9 commit 0097ff0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export let bccReady = new Promise((resolve, reject) => {
*/
const percentageThreshold = 100 / 9;
let lastPercentage = 0;
let waitForLoadingAnimation;
let waitForLoadingAnimation = Promise.resolve();
let percentagesSet = [ ];

/**
Expand Down Expand Up @@ -148,14 +148,14 @@ export function showError() {
* @return {string} additional returnObject
*/
export async function raiseProgress(percentage: number, returnObj?: any) {
// wait for last animation to be finished
await this.waitForLoadingAnimation;

lastPercentage += percentage;
if (lastPercentage > 100) {
lastPercentage = 100;
}

// wait for last animation to be finished
await this.waitForLoadingAnimation;

// set the percentage only, if it wasn't set before
if (!percentagesSet[lastPercentage]) {
percentagesSet[lastPercentage] = true;
Expand Down

0 comments on commit 0097ff0

Please sign in to comment.