mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent crash if not on contact fragment before navigating to editor
This commit is contained in:
parent
6210ecb520
commit
52cb8ca3a3
2 changed files with 7 additions and 5 deletions
|
|
@ -41,7 +41,6 @@ import org.linphone.LinphoneApplication.Companion.corePreferences
|
|||
import org.linphone.R
|
||||
import org.linphone.compatibility.Compatibility
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.ui.main.settings.fragment.SettingsFragment
|
||||
import org.linphone.utils.ToastUtils
|
||||
import org.linphone.utils.slideInToastFromTop
|
||||
import org.linphone.utils.slideInToastFromTopForDuration
|
||||
|
|
|
|||
|
|
@ -185,10 +185,13 @@ class ContactFragment : SlidingPaneChildFragment() {
|
|||
|
||||
viewModel.openLinphoneContactEditor.observe(viewLifecycleOwner) {
|
||||
it.consume { refKey ->
|
||||
val action = ContactFragmentDirections.actionContactFragmentToEditContactFragment(
|
||||
refKey
|
||||
)
|
||||
findNavController().navigate(action)
|
||||
if (findNavController().currentDestination?.id == R.id.contactFragment) {
|
||||
val action =
|
||||
ContactFragmentDirections.actionContactFragmentToEditContactFragment(
|
||||
refKey
|
||||
)
|
||||
findNavController().navigate(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue