Skip to content

Commit

Permalink
Adapt for fast registration flow
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao committed Jun 8, 2020
1 parent afc14a7 commit c4f9c45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
androidTestImplementation 'androidx.test:rules:1.3.0-alpha03'

implementation 'network.mysterium:mobile-node:0.33.0-rc0'
implementation 'network.mysterium:mobile-node:0.34.1'
// Comment network.mysterium:mobile-node and replace with your local path to use local node build.
// implementation files('/Users/anjmao/go/src/github.com/mysteriumnetwork/node/build/package/Mysterium.aar')
}
Expand Down
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 c4f9c45

Please sign in to comment.