Skip to content

Commit c3a683f

Browse files
committed
nit: don't force executions if token no change
1 parent 2a7edec commit c3a683f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/LoginHelper.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ internal class LoginHelper(
4040
// Same-user refresh path (e.g. login(sameId, freshJwt) after a 401). Store the
4141
// fresh token and wake the queue so any ops deferred by `hasValidJwtIfRequired`
4242
// dispatch immediately — symmetric with `updateUserJwt`. putJwt no-ops on null.
43-
jwtTokenStore.putJwt(externalId, jwtBearerToken)
44-
operationRepo.forceExecuteOperations()
43+
if (jwtBearerToken != null) {
44+
jwtTokenStore.putJwt(externalId, jwtBearerToken)
45+
operationRepo.forceExecuteOperations()
46+
}
4547
return null
4648
}
4749

0 commit comments

Comments
 (0)