Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit aeda971

Browse files
committed
Address code review comments: spelling error, minor syntax change, and comment content in FirebaseArray.js
1 parent 9f55685 commit aeda971

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/FirebaseAuth.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,24 +251,21 @@
251251
return this._initialAuthResolver.then(function() {
252252
// auth state may change in the future so rather than depend on the initially resolved state
253253
// we also check the auth data (synchronously) if a new promise is requested, ensuring we resolve
254-
// to the current auth state and not a stale/initial state (see https://github.com/firebase/angularfire/issues/590)
254+
// to the current auth state and not a stale/initial state
255255
var authData = ref.getAuth(), res = null;
256-
if (authData !== null) {
257-
res = utils.resolve(authData);
258-
}
259-
else if (rejectIfAuthDataIsNull) {
256+
if (rejectIfAuthDataIsNull && authData === null) {
260257
res = utils.reject("AUTH_REQUIRED");
261258
}
262259
else {
263-
res = utils.resolve(null);
260+
res = utils.resolve(authData);
264261
}
265262
return res;
266263
});
267264
},
268265

269266
/**
270267
* Helper that returns a promise which resolves when the initial auth state has been
271-
* fetch from the Firebase server. This never rejects and resolves to undefined.
268+
* fetched from the Firebase server. This never rejects and resolves to undefined.
272269
*
273270
* @return {Promise<Object>} A promise fulfilled when the server returns initial auth state.
274271
*/

0 commit comments

Comments
 (0)