Unverified Commit 81de4f59 authored by Leonardo Aramaki's avatar Leonardo Aramaki Committed by GitHub

Merge branch 'develop-2.x' into new/version-check

parents 1e778869 41e40af7
...@@ -14,6 +14,7 @@ import chat.rocket.android.server.presentation.CheckServerPresenter ...@@ -14,6 +14,7 @@ import chat.rocket.android.server.presentation.CheckServerPresenter
import chat.rocket.android.util.VersionInfo import chat.rocket.android.util.VersionInfo
import chat.rocket.android.util.extensions.* import chat.rocket.android.util.extensions.*
import chat.rocket.common.RocketChatException import chat.rocket.common.RocketChatException
import chat.rocket.common.RocketChatTwoFactorException
import chat.rocket.common.model.Token import chat.rocket.common.model.Token
import chat.rocket.common.util.ifNull import chat.rocket.common.util.ifNull
import chat.rocket.core.RocketChatClient import chat.rocket.core.RocketChatClient
...@@ -224,11 +225,18 @@ class LoginPresenter @Inject constructor(private val view: LoginView, ...@@ -224,11 +225,18 @@ class LoginPresenter @Inject constructor(private val view: LoginView,
registerPushToken() registerPushToken()
navigator.toChatList() navigator.toChatList()
} catch (exception: RocketChatException) { } catch (exception: RocketChatException) {
when (exception) {
is RocketChatTwoFactorException -> {
navigator.toTwoFA(usernameOrEmail, password)
}
else -> {
exception.message?.let { exception.message?.let {
view.showMessage(it) view.showMessage(it)
}.ifNull { }.ifNull {
view.showGenericErrorMessage() view.showGenericErrorMessage()
} }
}
}
} finally { } finally {
view.hideLoading() view.hideLoading()
view.enableUserInput() view.enableUserInput()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment