Small improvement

This commit is contained in:
Benoit Marty 2020-05-09 17:14:27 +02:00
parent 756b0febe6
commit e962d1dadf
2 changed files with 5 additions and 2 deletions

View File

@ -199,7 +199,7 @@ internal class DefaultRegistrationWizard(
code = code
)
val validationResponse = validateCodeTask.execute(ValidateCodeTask.Params(url, validationBody))
if (validationResponse.success == true) {
if (validationResponse.isSuccess()) {
// The entered code is correct
// Same than validate email
return performRegistrationRequest(registrationParams, 3_000)

View File

@ -18,9 +18,12 @@ package im.vector.matrix.android.internal.auth.registration
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import im.vector.matrix.android.api.extensions.orFalse
@JsonClass(generateAdapter = true)
data class SuccessResult(
@Json(name = "success")
val success: Boolean?
)
) {
fun isSuccess() = success.orFalse()
}