Do not create new navigation instance if already on chat, chats or calls screen
This commit is contained in:
@ -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 }
|
||||||
|
|||||||
Reference in New Issue
Block a user