File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
packages/firestore/src/api Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -481,17 +481,15 @@ export class FirebaseAppCheckTokenProvider
481
481
`Error getting App Check token; using placeholder token instead. Error: ${ tokenResult . error . message } `
482
482
) ;
483
483
}
484
- if ( tokenResult . token !== this . latestAppCheckToken ) {
485
- logDebug ( 'FirebaseAppCheckTokenProvider' , 'Received a new token.' ) ;
486
- this . latestAppCheckToken = tokenResult . token ;
487
- return changeListener ( tokenResult . token ) ;
488
- } else {
489
- logDebug (
490
- 'FirebaseAppCheckTokenProvider' ,
491
- 'Received a token that is the same as the existing token.'
492
- ) ;
493
- return Promise . resolve ( ) ;
494
- }
484
+ const tokenUpdated = tokenResult . token !== this . latestAppCheckToken ;
485
+ this . latestAppCheckToken = tokenResult . token ;
486
+ logDebug (
487
+ 'FirebaseAppCheckTokenProvider' ,
488
+ `Received ${ tokenUpdated ? 'new' : 'existing' } token.`
489
+ ) ;
490
+ return tokenUpdated
491
+ ? changeListener ( tokenResult . token )
492
+ : Promise . resolve ( ) ;
495
493
} ;
496
494
497
495
this . tokenListener = ( tokenResult : AppCheckTokenResult ) => {
You can’t perform that action at this time.
0 commit comments