Add missing loading state

This commit is contained in:
Benoit Marty 2021-04-26 11:00:57 +02:00
parent ae4ae4111d
commit bcbc6c0f7c

View File

@ -19,6 +19,7 @@ package im.vector.app.features.createdirect
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.airbnb.mvrx.ActivityViewModelContext import com.airbnb.mvrx.ActivityViewModelContext
import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success import com.airbnb.mvrx.Success
import com.airbnb.mvrx.ViewModelContext import com.airbnb.mvrx.ViewModelContext
@ -82,6 +83,8 @@ class CreateDirectRoomViewModel @AssistedInject constructor(@Assisted
} }
private fun createRoomAndInviteSelectedUsers(selections: Set<PendingSelection>) { private fun createRoomAndInviteSelectedUsers(selections: Set<PendingSelection>) {
setState { copy(createAndInviteState = Loading()) }
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
val adminE2EByDefault = rawService.getElementWellknown(session.myUserId) val adminE2EByDefault = rawService.getElementWellknown(session.myUserId)
?.isE2EByDefault() ?.isE2EByDefault()