mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 21:48:50 +03:00
Login sso: handle failure
This commit is contained in:
parent
2e50d2a36e
commit
f265724a3c
1 changed files with 5 additions and 1 deletions
|
@ -134,6 +134,10 @@ class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginVi
|
|||
override fun onSuccess(data: Session) {
|
||||
onSessionCreated(data)
|
||||
}
|
||||
|
||||
override fun onFailure(failure: Throwable) = setState {
|
||||
copy(asyncLoginAction = Fail(failure))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +154,7 @@ class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginVi
|
|||
|
||||
// Do not retry if we already have flows for this config -> causes infinite focus loop
|
||||
if (newConfig?.homeServerUri?.toString() == homeServerConnectionConfig?.homeServerUri?.toString()
|
||||
&& state.asyncHomeServerLoginFlowRequest is Success) return@withState
|
||||
&& state.asyncHomeServerLoginFlowRequest is Success) return@withState
|
||||
|
||||
currentTask?.cancel()
|
||||
homeServerConnectionConfig = newConfig
|
||||
|
|
Loading…
Reference in a new issue