Improve code

This commit is contained in:
Benoit Marty 2020-05-11 00:10:41 +02:00
parent 34cf9903dc
commit b659cb60a2

View file

@ -33,7 +33,6 @@ import im.vector.riotx.core.epoxy.attributes.ButtonType
import im.vector.riotx.core.epoxy.attributes.IconMode
import im.vector.riotx.core.epoxy.loadingItem
import im.vector.riotx.core.error.ErrorFormatter
import im.vector.riotx.core.extensions.exhaustive
import im.vector.riotx.core.resources.ColorProvider
import im.vector.riotx.core.resources.StringProvider
import timber.log.Timber
@ -244,9 +243,7 @@ class DiscoverySettingsController @Inject constructor(
if (pidInfo.isShared is Fail) {
buildSharedFail(pidInfo)
}
when (pidInfo.isShared()) {
SharedState.BINDING_IN_PROGRESS -> {
} else if (pidInfo.isShared() == SharedState.BINDING_IN_PROGRESS) {
val errorText = if (pidInfo.finalRequest is Fail) {
val error = pidInfo.finalRequest.error
// Deal with error 500
@ -280,8 +277,6 @@ class DiscoverySettingsController @Inject constructor(
}
buildContinueCancel(pidInfo.threePid)
}
else -> Unit
}.exhaustive
}
private fun buildThreePid(pidInfo: PidInfo, title: String = pidInfo.threePid.value) {