Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading-bar completion timeout always displays 100% bar with new requests within 500ms #29

Closed
bbottema opened this issue Dec 24, 2013 · 1 comment
Labels

Comments

@bbottema
Copy link
Contributor

I have a situation in which multiple requests start simultaneously and cascade new requests on their own.

Because of the initial small requests, loading-bar gets to 100% within a second. Within 500ms of completing the request, new calls are fired away, which actually take most of the time. The progress bar however does not reset or reflect work to be done: it just stays on 100% until finally the last requests are finished. In effect the prograss bar is stuck at 100% almost at the beginning for several seconds.

One solution it to keep setting the progress, even in the 'request' function around line 94:

      return {
        'request': function(config) {
          if (!config.ignoreLoadingBar && !isCached(config)) {
            if (reqsTotal === 0) {
              cfpLoadingBar.start();
            }
            reqsTotal++;
            cfpLoadingBar.set(reqsCompleted / reqsTotal); // added this line
          }
          return config;
        },

The downside of this is it does not take into account the previous requests being completed: it just starts over.

@chieffancypants
Copy link
Owner

closed with #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants