mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 02:45:53 +03:00
Add a delay to avoid crash. Sounds like a workaround...
This commit is contained in:
parent
e859357c6a
commit
cfdf5cb552
1 changed files with 12 additions and 2 deletions
|
@ -19,6 +19,7 @@ package im.vector.riotx.features.login
|
|||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.airbnb.mvrx.ActivityViewModelContext
|
||||
import com.airbnb.mvrx.Fail
|
||||
import com.airbnb.mvrx.Loading
|
||||
|
@ -53,6 +54,8 @@ import im.vector.riotx.features.call.WebRtcPeerConnectionManager
|
|||
import im.vector.riotx.features.notifications.PushRuleTriggerListener
|
||||
import im.vector.riotx.features.session.SessionListener
|
||||
import im.vector.riotx.features.signout.soft.SoftLogoutActivity
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import java.util.concurrent.CancellationException
|
||||
|
||||
|
@ -399,9 +402,16 @@ class LoginViewModel @AssistedInject constructor(
|
|||
when (action.signMode) {
|
||||
SignMode.SignUp -> startRegistrationFlow()
|
||||
SignMode.SignIn -> startAuthenticationFlow()
|
||||
SignMode.SignInWithMatrixId -> _viewEvents.post(LoginViewEvents.OnSignModeSelected)
|
||||
SignMode.SignInWithMatrixId -> {
|
||||
viewModelScope.launch {
|
||||
// Add a delay to avoid crash
|
||||
delay(50)
|
||||
_viewEvents.post(LoginViewEvents.OnSignModeSelected)
|
||||
}
|
||||
Unit
|
||||
}
|
||||
SignMode.Unknown -> Unit
|
||||
}.exhaustive
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleUpdateServerType(action: LoginAction.UpdateServerType) {
|
||||
|
|
Loading…
Reference in a new issue