fix: stop polluting backstack with unlive channels
This commit is contained in:
parent
61bfda37f2
commit
8c6fa7ac1c
|
|
@ -67,7 +67,11 @@ fun RowScope.ChannelList(
|
|||
)
|
||||
} ?: false,
|
||||
onClick = {
|
||||
navController.navigate("channel/${channel.id}")
|
||||
navController.navigate("channel/${channel.id}") {
|
||||
navController.graph.startDestinationRoute?.let { route ->
|
||||
popUpTo(route)
|
||||
}
|
||||
}
|
||||
coroutineScope.launch { drawerState.focusCenter() }
|
||||
},
|
||||
onLongClick = {
|
||||
|
|
@ -109,8 +113,8 @@ fun RowScope.ChannelList(
|
|||
onClick = {
|
||||
coroutineScope.launch { drawerState.focusCenter() }
|
||||
navController.navigate("channel/${ch.id}") {
|
||||
popUpTo("home") {
|
||||
inclusive = true
|
||||
navController.graph.startDestinationRoute?.let { route ->
|
||||
popUpTo(route)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ class ChatRouterViewModel : ViewModel() {
|
|||
|
||||
if (serverId == "home") {
|
||||
navController.navigate("home") {
|
||||
popUpTo("home") {
|
||||
inclusive = true
|
||||
navController.graph.startDestinationRoute?.let { route ->
|
||||
popUpTo(route)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
|
@ -73,8 +73,8 @@ class ChatRouterViewModel : ViewModel() {
|
|||
|
||||
val channelId = RevoltAPI.serverCache[serverId]?.channels?.firstOrNull()
|
||||
navController.navigate("channel/$channelId") {
|
||||
popUpTo("home") {
|
||||
inclusive = true
|
||||
navController.graph.startDestinationRoute?.let { route ->
|
||||
popUpTo(route)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue