Login: should fix case after logout...
This commit is contained in:
parent
bf64c8945a
commit
cf0570661d
2 changed files with 3 additions and 9 deletions
|
|
@ -24,9 +24,7 @@ class LoginViewModel(initialState: LoginViewState) :
|
|||
suspend {
|
||||
val state = awaitState()
|
||||
// Ensure the server is provided to the Rust SDK
|
||||
if (matrix.getHomeserver() == null) {
|
||||
matrix.setHomeserver(state.homeserver)
|
||||
}
|
||||
matrix.setHomeserver(state.homeserver)
|
||||
matrix.login(state.login.trim(), state.password.trim())
|
||||
matrix.activeClient().startSync()
|
||||
}.execute {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package io.element.android.x.features.login.changeserver
|
||||
|
||||
import com.airbnb.mvrx.Loading
|
||||
import com.airbnb.mvrx.MavericksViewModel
|
||||
import io.element.android.x.matrix.MatrixInstance
|
||||
import kotlinx.coroutines.launch
|
||||
|
|
@ -24,13 +23,10 @@ class ChangeServerViewModel(initialState: ChangeServerViewState) :
|
|||
}
|
||||
}
|
||||
|
||||
fun setServerSubmit() = withState { state ->
|
||||
setState {
|
||||
copy(changeServerAction = Loading())
|
||||
}
|
||||
|
||||
fun setServerSubmit() {
|
||||
viewModelScope.launch {
|
||||
suspend {
|
||||
val state = awaitState()
|
||||
matrix.setHomeserver(state.homeserver)
|
||||
}.execute { it ->
|
||||
copy(changeServerAction = it)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue