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

Commit 04309e8

Browse files
Merge pull request #69 from guillaume-roy/master
Fix onAuthStateChanged feature on init method
2 parents fff74e0 + 159a74a commit 04309e8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

firebase.android.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ firebase.init = function (arg) {
141141
if (arg.onAuthStateChanged) {
142142
firebase.authStateListener = new com.google.firebase.auth.FirebaseAuth.AuthStateListener({
143143
onAuthStateChanged: function (fbAuth) {
144-
console.log("--------- auth change (1), user: " + user);
145144
var user = fbAuth.getCurrentUser();
145+
console.log("--------- auth change (1), user: " + user);
146146
arg.onAuthStateChanged({
147147
loggedIn: user !== null,
148148
user: toLoginResult(user)
@@ -156,8 +156,8 @@ firebase.init = function (arg) {
156156
if (!firebase.authStateListener) {
157157
firebase.authStateListener = new com.google.firebase.auth.FirebaseAuth.AuthStateListener({
158158
onAuthStateChanged: function (fbAuth) {
159-
console.log("--------- auth change (2), user: " + user);
160159
var user = fbAuth.getCurrentUser();
160+
console.log("--------- auth change (2), user: " + user);
161161
firebase.notifyAuthStateListeners({
162162
loggedIn: user !== null,
163163
user: toLoginResult(user)

firebase.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ declare module "nativescript-plugin-firebase" {
1010
*/
1111
persist?: boolean;
1212
/**
13-
* Get notified when fi the user is logged in.
13+
* Get notified when the user is logged in.
1414
*/
15-
onAuthStateChange?: AuthStateChangeListener;
15+
onAuthStateChanged?: (data: AuthStateData) => void;
1616
/**
1717
* Attempt to sign out before initializing, useful in case previous
1818
* project token is cached which leads to following type of error:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-plugin-firebase",
3-
"version": "3.3.0",
3+
"version": "3.3.1",
44
"description" : "Fire. Base. Firebase!",
55
"main" : "firebase.js",
66
"nativescript": {

0 commit comments

Comments
 (0)