From 133f533b873380b6d172129dd76d5d88848dfb8e Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 23 May 2024 12:00:15 +0200 Subject: [PATCH] Fixed back stack when sharing logs using conversation --- .../java/org/linphone/ui/main/MainActivity.kt | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/linphone/ui/main/MainActivity.kt b/app/src/main/java/org/linphone/ui/main/MainActivity.kt index f83980653..d0934c83e 100644 --- a/app/src/main/java/org/linphone/ui/main/MainActivity.kt +++ b/app/src/main/java/org/linphone/ui/main/MainActivity.kt @@ -53,6 +53,7 @@ import org.linphone.ui.GenericActivity import org.linphone.ui.assistant.AssistantActivity import org.linphone.ui.main.chat.fragment.ConversationsListFragmentDirections import org.linphone.ui.main.fragment.AuthRequestedDialogModel +import org.linphone.ui.main.help.fragment.DebugFragmentDirections import org.linphone.ui.main.sso.fragment.SingleSignOnFragmentDirections import org.linphone.ui.main.viewmodel.MainViewModel import org.linphone.ui.main.viewmodel.SharedMainViewModel @@ -559,6 +560,9 @@ class MainActivity : GenericActivity() { ) sharedViewModel.showConversationEvent.value = Event(pair) } + + val action = DebugFragmentDirections.actionDebugFragmentToConversationsListFragment() + findNavController().navigate(action) } else { val pair = parseShortcutIfAny(intent) if (pair != null) { @@ -569,14 +573,15 @@ class MainActivity : GenericActivity() { ) sharedViewModel.showConversationEvent.value = Event(pair) } - } - if (findNavController().currentDestination?.id == R.id.conversationsListFragment) { - Log.w("$TAG Current destination is already conversations list, skipping navigation") - } else { - val action = - ConversationsListFragmentDirections.actionGlobalConversationsListFragment() - findNavController().navigate(action) + if (findNavController().currentDestination?.id == R.id.conversationsListFragment) { + Log.w( + "$TAG Current destination is already conversations list, skipping navigation" + ) + } else { + val action = ConversationsListFragmentDirections.actionGlobalConversationsListFragment() + findNavController().navigate(action) + } } } } @@ -587,7 +592,7 @@ class MainActivity : GenericActivity() { Log.i("$TAG Found shortcut ID [$shortcutId]") return LinphoneUtils.getLocalAndPeerSipUrisFromChatRoomId(shortcutId) } else { - Log.i("$TAG No shortcut ID as found") + Log.i("$TAG No shortcut ID was found") } return null }