Fixed back navigation when in conversation opened from meeting call history

This commit is contained in:
Sylvain Berfini 2025-01-16 13:56:58 +01:00
parent 9504c6d1ca
commit 15f9d04747

View file

@ -389,16 +389,20 @@ open class ConversationFragment : SlidingPaneChildFragment() {
}
override fun goBack(): Boolean {
sharedViewModel.closeSlidingPaneEvent.value = Event(true)
sharedViewModel.displayedChatRoom = null
if (!findNavController().popBackStack()) {
sharedViewModel.closeSlidingPaneEvent.value = Event(true)
sharedViewModel.displayedChatRoom = null
if (findNavController().currentDestination?.id == R.id.conversationFragment) {
// If not done this fragment won't be paused, which will cause us issues
val action = ConversationFragmentDirections.actionConversationFragmentToEmptyFragment()
findNavController().navigate(action)
return true
if (findNavController().currentDestination?.id == R.id.conversationFragment) {
// If not done this fragment won't be paused, which will cause us issues
val action =
ConversationFragmentDirections.actionConversationFragmentToEmptyFragment()
findNavController().navigate(action)
return true
}
return false
}
return false
return true
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {