Skip to content

Commit 19d5c9c

Browse files
committed
Use fewer bytes for log messages.
1 parent 5d81764 commit 19d5c9c

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

packages/firestore/src/api/credentials.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -481,17 +481,15 @@ export class FirebaseAppCheckTokenProvider
481481
`Error getting App Check token; using placeholder token instead. Error: ${tokenResult.error.message}`
482482
);
483483
}
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();
495493
};
496494

497495
this.tokenListener = (tokenResult: AppCheckTokenResult) => {

0 commit comments

Comments
 (0)