Skip to content

Commit

Permalink
Address code review comments: spelling error, minor syntax change, an…
Browse files Browse the repository at this point in the history
…d comment content in FirebaseArray.js
  • Loading branch information
katowulf committed May 1, 2015
1 parent 9f55685 commit aeda971
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/FirebaseAuth.js
Expand Up @@ -251,24 +251,21 @@
return this._initialAuthResolver.then(function() {
// auth state may change in the future so rather than depend on the initially resolved state
// we also check the auth data (synchronously) if a new promise is requested, ensuring we resolve
// to the current auth state and not a stale/initial state (see https://github.com/firebase/angularfire/issues/590)
// to the current auth state and not a stale/initial state
var authData = ref.getAuth(), res = null;
if (authData !== null) {
res = utils.resolve(authData);
}
else if (rejectIfAuthDataIsNull) {
if (rejectIfAuthDataIsNull && authData === null) {
res = utils.reject("AUTH_REQUIRED");
}
else {
res = utils.resolve(null);
res = utils.resolve(authData);
}
return res;
});
},

/**
* Helper that returns a promise which resolves when the initial auth state has been
* fetch from the Firebase server. This never rejects and resolves to undefined.
* fetched from the Firebase server. This never rejects and resolves to undefined.
*
* @return {Promise<Object>} A promise fulfilled when the server returns initial auth state.
*/
Expand Down

0 comments on commit aeda971

Please sign in to comment.