Skip to content

Commit

Permalink
Return the if directly
Browse files Browse the repository at this point in the history
  • Loading branch information
wching committed Feb 7, 2020
1 parent 08328e2 commit 9074cc5
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -30,15 +30,14 @@ open class OAuth2AccessTokenManager(
): Single<OAuth2AccessToken> =
grant.grantNewAccessToken()
.map {
val token = if (it.expiresIn != null) {
if (it.expiresIn != null) {
val newExpirationDate = (calendar.clone() as Calendar).apply {
add(Calendar.SECOND, it.expiresIn)
}
it.copy(expirationDate = newExpirationDate)
} else {
it
}
token
}
.doOnSuccess { token ->
mStorage.storeAccessToken(
Expand Down

0 comments on commit 9074cc5

Please sign in to comment.