Prevent going back to operation in progress dialog after hanging up started group call, also go back to calls history

This commit is contained in:
Sylvain Berfini 2025-02-27 14:48:28 +01:00
parent 4afa2ebc93
commit 990549eb24
2 changed files with 13 additions and 3 deletions

View file

@ -120,7 +120,11 @@ class StartCallFragment : GenericAddressPickerFragment() {
viewModel.leaveFragmentEvent.observe(viewLifecycleOwner) {
it.consume {
goBack()
// Post on main thread to allow for main activity to be resumed
coreContext.postOnMainThread {
Log.i("$TAG Going back")
goBack()
}
}
}

View file

@ -84,8 +84,14 @@ class StartCallViewModel
@WorkerThread
override fun onStateChanged(conference: Conference, newState: Conference.State?) {
Log.i("$TAG Conference state changed [$newState]")
if (newState == Conference.State.Created || newState == Conference.State.CreationFailed) {
operationInProgress.postValue(false)
when (newState) {
Conference.State.Created, Conference.State.CreationFailed, Conference.State.TerminationPending -> {
operationInProgress.postValue(false)
}
Conference.State.Terminated -> {
leaveFragmentEvent.postValue(Event(true))
}
else -> {}
}
}
}