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