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

Commit abe2c95

Browse files
committed
add return statements
1 parent a7c767c commit abe2c95

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/FirebaseAuth.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,20 @@
225225

226226
return this._utils.promise(function(resolve,reject){
227227
function callback(authData) {
228+
// Turn off this onAuth() callback since we just needed to get the authentication data once.
229+
ref.offAuth(callback);
230+
228231
if (authData !== null) {
229232
resolve(authData);
230-
} else if (rejectIfAuthDataIsNull) {
233+
return;
234+
}
235+
else if (rejectIfAuthDataIsNull) {
231236
reject("AUTH_REQUIRED");
232-
} else {
237+
return;
238+
}
239+
else {
233240
resolve(null);
234241
}
235-
236-
// Turn off this onAuth() callback since we just needed to get the authentication data once.
237-
ref.offAuth(callback);
238242
}
239243

240244
ref.onAuth(callback);

src/firebase.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@
132132
ref.transaction(valueFn, function(err, committed, snap) {
133133
if( err ) {
134134
reject(err);
135+
return;
135136
}
136137
else {
137138
resolve(committed? snap : null);
139+
return;
138140
}
139141
}, applyLocally);
140142
});

0 commit comments

Comments
 (0)