Skip to content

Commit 95babba

Browse files
committed
Update registerStateListener internal method signature and structure
1 parent bd77aed commit 95babba

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/auth/src/core/auth/auth_impl.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
647647
return this.registerStateListener(
648648
this.authStateSubscription,
649649
nextOrObserver,
650+
this.currentUser,
650651
error,
651652
completed
652653
);
@@ -667,6 +668,7 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
667668
return this.registerStateListener(
668669
this.idTokenSubscription,
669670
nextOrObserver,
671+
this.currentUser,
670672
error,
671673
completed
672674
);
@@ -814,9 +816,10 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
814816
}
815817
}
816818

817-
private registerStateListener(
818-
subscription: Subscription<User>,
819-
nextOrObserver: NextOrObserver<User>,
819+
private registerStateListener<T>(
820+
subscription: Subscription<T>,
821+
nextOrObserver: NextOrObserver<T>,
822+
currentValue: T | null,
820823
error?: ErrorFn,
821824
completed?: CompleteFn
822825
): Unsubscribe {
@@ -841,7 +844,7 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
841844
if (isUnsubscribed) {
842845
return;
843846
}
844-
cb(this.currentUser);
847+
cb(currentValue);
845848
});
846849

847850
if (typeof nextOrObserver === 'function') {

0 commit comments

Comments
 (0)