refactor: Messages navigation to single contactKey argument

This commit is contained in:
andrekir 2024-11-28 08:42:49 -03:00
parent 1c42bd262f
commit 44d195a4a5
5 changed files with 25 additions and 34 deletions

View file

@ -327,9 +327,7 @@ class MainActivity : AppCompatActivity(), Logging {
MeshServiceNotifications.OPEN_MESSAGE_ACTION -> {
val contactKey =
intent.getStringExtra(MeshServiceNotifications.OPEN_MESSAGE_EXTRA_CONTACT_KEY)
val contactName =
intent.getStringExtra(MeshServiceNotifications.OPEN_MESSAGE_EXTRA_CONTACT_NAME)
showMessages(contactKey, contactName)
showMessages(contactKey)
}
UsbManager.ACTION_USB_DEVICE_ATTACHED -> {
@ -602,10 +600,10 @@ class MainActivity : AppCompatActivity(), Logging {
binding.pager.currentItem = 5
}
private fun showMessages(contactKey: String?, contactName: String?) {
private fun showMessages(contactKey: String?) {
model.setCurrentTab(0)
if (contactKey != null && contactName != null) {
supportFragmentManager.navigateToMessages(contactKey, contactName)
if (contactKey != null) {
supportFragmentManager.navigateToMessages(contactKey)
}
}