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

Logout button triggers lots of recomputes #340

Open
m-mujica opened this issue Oct 6, 2017 · 0 comments
Open

Logout button triggers lots of recomputes #340

m-mujica opened this issue Oct 6, 2017 · 0 comments

Comments

@m-mujica
Copy link
Contributor

m-mujica commented Oct 6, 2017

When logout is clicked, there is a compute that cycles a lot times (happens in dev, and with optimized build).

If you have the dev-tools open you can see it hitting the else in the code below a bunch of times:

// can-connect-feathers/session/session
getData: function() {
    return new Promise(function(resolve, reject) {
      var tokenLocation = options.tokenKey || options.cookie;
      if (hasValidToken(tokenLocation) && !window.doneSsr) {
        feathersClient
          .authenticate()
          .then(function(data) {
            var payload = decode(data.accessToken);
            return resolve(payload);
          })
          .catch(reject);
      } else {
        reject(new errors.NotAuthenticated("Not Authenticated"));
      }
    });
  }

I added a console.log before the rejection and:

screen shot 2017-10-05 at 11 36 57

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

No branches or pull requests

1 participant