Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 5c0321c

Browse files
Merge pull request #987 from vratojr/master
Adding authListener to the list of listeners if passed in 'init'
2 parents 730cab7 + 0e35ecd commit 5c0321c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/firebase.android.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,7 @@ firebase.init = arg => {
312312
const firebaseAuth = com.google.firebase.auth.FirebaseAuth.getInstance();
313313

314314
if (arg.onAuthStateChanged) {
315-
firebase.authStateListener = new com.google.firebase.auth.FirebaseAuth.AuthStateListener({
316-
onAuthStateChanged: fbAuth => {
317-
const user = fbAuth.getCurrentUser();
318-
arg.onAuthStateChanged({
319-
loggedIn: user !== null,
320-
user: toLoginResult(user)
321-
});
322-
}
323-
});
324-
firebaseAuth.addAuthStateListener(firebase.authStateListener);
315+
firebase.addAuthStateListener(arg.onAuthStateChanged)
325316
}
326317

327318
// Listen to auth state changes

0 commit comments

Comments
 (0)