Skip to content

Commit

Permalink
Merge pull request #2730 from Automattic/fix/user-fetch-error-prevent…
Browse files Browse the repository at this point in the history
…s-further-attempts

User: Fix bug where fetch error prevents any further attempts
  • Loading branch information
jordwest committed Jan 28, 2016
2 parents e36c7bb + b52320e commit 7719da4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/lib/user/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ User.prototype.fetch = function() {
debug( 'Getting user from api' );

me.get( { meta: 'flags' }, function( error, data ) {
// Release lock from subsequent fetches
this.fetching = false;

if ( error ) {
if ( ! config( 'wpcom_user_bootstrap' ) && error.error === 'authorization_required' ) {
/**
Expand All @@ -125,9 +128,6 @@ User.prototype.fetch = function() {

var userData = userUtils.filterUserObject( data );

// Release lock from subsequent fetches
this.fetching = false;

this.clearStoreIfChanged( userData.ID );

// Store user info in `this.data` and localstorage as `wpcom_user`
Expand Down

0 comments on commit 7719da4

Please sign in to comment.