Skip to content

Commit

Permalink
Merge pull request #199 from mysteriumnetwork/fast-identity-registration
Browse files Browse the repository at this point in the history
Adapt for fast registration flow
  • Loading branch information
anjmao authored Jun 10, 2020
2 parents 26389ef + c4f9c45 commit 71f1697
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ class IdentityModel(
val channelAddress: String,
var status: IdentityRegistrationStatus
) {
// Identity is considered as registered if it's status RegisteredConsumer or InProgress since we support fast
// identity registration flow which means there is no need to wait for actual registration.
val registered: Boolean
get() {
return status == IdentityRegistrationStatus.REGISTERED_CONSUMER
return status == IdentityRegistrationStatus.REGISTERED_CONSUMER || status == IdentityRegistrationStatus.IN_PROGRESS
}


val registrationFailed: Boolean
get() {
return status == IdentityRegistrationStatus.REGISTRATION_ERROR
Expand Down Expand Up @@ -113,7 +116,7 @@ class AccountViewModel(private val nodeRepository: NodeRepository, private val b
)
identity.value = identityResult
bugReporter.setUserIdentifier(nodeIdentity.address)
Log.i(TAG, "Loaded identity ${nodeIdentity.address}, channel addr: ${nodeIdentity.channelAddress}")
Log.i(TAG, "Loaded identity ${nodeIdentity.address}, channel addr: ${nodeIdentity.channelAddress}, status: ${nodeIdentity.registrationStatus}")

// Register identity if not registered or failed.
if (identityResult.status == IdentityRegistrationStatus.UNREGISTERED || identityResult.status == IdentityRegistrationStatus.REGISTRATION_ERROR) {
Expand Down

0 comments on commit 71f1697

Please sign in to comment.