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