Fixed click on notification no going into conversation

This commit is contained in:
Sylvain Berfini 2024-01-09 12:56:39 +01:00
parent a547a04258
commit e1c1be3e50

View file

@ -370,23 +370,11 @@ class MainActivity : GenericActivity() {
Log.i("$TAG New intent with [Chat] extra") Log.i("$TAG New intent with [Chat] extra")
if (isNewIntent) { if (isNewIntent) {
try { try {
val navGraphId = findNavController().graph.id Log.i("$TAG Trying to go to Conversations fragment")
if (navGraphId == R.navigation.main_nav_graph) { findNavController().navigate(
Log.i("$TAG Graph is already loaded, going to Conversations fragment") R.id.action_global_conversationsListFragment,
findNavController().navigate( intent.extras
R.id.action_global_conversationsListFragment, )
intent.extras
)
} else {
Log.i(
"$TAG Loading graph & set start destination to Conversations fragment instead of default"
)
val navGraph = findNavController().navInflater.inflate(
R.navigation.main_nav_graph
)
navGraph.setStartDestination(R.id.conversationsListFragment)
findNavController().setGraph(navGraph, intent.extras)
}
} catch (ise: IllegalStateException) { } catch (ise: IllegalStateException) {
Log.i( Log.i(
"$TAG Nav graph not set yet, loading it & set start destination to Conversations fragment instead of default" "$TAG Nav graph not set yet, loading it & set start destination to Conversations fragment instead of default"