Do not create new navigation instance if already on chat, chats or calls screen

This commit is contained in:
Juha Heinanen
2026-07-19 21:36:45 +03:00
parent f9114cbc47
commit c8f54de980

View File

@ -250,15 +250,14 @@ class MainActivity : ComponentActivity() {
when (command) { when (command) {
is NavigationCommand.NavigateToChat -> { is NavigationCommand.NavigateToChat -> {
val route = "chat/${command.aor}/${command.peerUri}" val route = "chat/${command.aor}/${command.peerUri}"
navController.navigate(route) navController.navigate(route) { launchSingleTop = true }
} }
is NavigationCommand.NavigateToCalls -> { is NavigationCommand.NavigateToCalls -> {
val route = "calls/${command.aor}" val route = "calls/${command.aor}"
navController.navigate(route) navController.navigate(route) { launchSingleTop = true }
}
is NavigationCommand.NavigateToChats -> {
navController.navigate("chats")
} }
is NavigationCommand.NavigateToChats ->
navController.navigate("chats") { launchSingleTop = true }
is NavigationCommand.NavigateToHome -> is NavigationCommand.NavigateToHome ->
navController.navigate("main") { navController.navigate("main") {
popUpTo("main") { inclusive = true } popUpTo("main") { inclusive = true }