Skip to content

Commit

Permalink
Fix login page flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
DaVinci9196 committed Sep 11, 2024
1 parent 108bd88 commit 9266119
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.google.android.gms.auth.api.identity.internal.IGetSignInIntentCallbac
import com.google.android.gms.auth.api.identity.internal.ISignInService
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.api.CommonStatusCodes
import com.google.android.gms.common.api.Status
import com.google.android.gms.common.api.internal.IStatusCallback
import com.google.android.gms.common.internal.ConnectionInfo
Expand Down Expand Up @@ -76,6 +77,12 @@ class IdentitySignInServiceImpl(private val context: Context, private val client
Log.d(TAG, "method 'beginSignIn' called")
Log.d(TAG, "request-> $request")
if (request.googleIdTokenRequestOptions.isSupported) {
val accounts = AccountManager.get(context).getAccountsByType(AuthConstants.DEFAULT_ACCOUNT_TYPE)
if (accounts.isEmpty()) {
Log.d(TAG, "accounts is empty, return CANCELED ")
callback.onResult(Status.CANCELED, null)
return
}
if (request.googleIdTokenRequestOptions.serverClientId.isNullOrEmpty()) {
Log.d(TAG, "serverClientId is empty, return CANCELED ")
callback.onResult(Status.CANCELED, null)
Expand Down

0 comments on commit 9266119

Please sign in to comment.