Skip to content

Commit

Permalink
add return statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestalmage committed Jan 15, 2015
1 parent a7c767c commit abe2c95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/FirebaseAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,20 @@

return this._utils.promise(function(resolve,reject){
function callback(authData) {
// Turn off this onAuth() callback since we just needed to get the authentication data once.
ref.offAuth(callback);

if (authData !== null) {
resolve(authData);
} else if (rejectIfAuthDataIsNull) {
return;
}
else if (rejectIfAuthDataIsNull) {
reject("AUTH_REQUIRED");
} else {
return;
}
else {
resolve(null);
}

// Turn off this onAuth() callback since we just needed to get the authentication data once.
ref.offAuth(callback);
}

ref.onAuth(callback);
Expand Down
2 changes: 2 additions & 0 deletions src/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@
ref.transaction(valueFn, function(err, committed, snap) {
if( err ) {
reject(err);
return;
}
else {
resolve(committed? snap : null);
return;
}
}, applyLocally);
});
Expand Down

0 comments on commit abe2c95

Please sign in to comment.