fix(android): prevent comments page from stacking when spammed

This commit is contained in:
Harsh Shandilya 2023-06-07 02:19:54 +05:30
parent 02575a917b
commit 7d491de86c
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View file

@ -41,9 +41,10 @@ fun rememberPostActions(
}
override fun viewComments(postId: String) {
navController.navigate(
val currentRoute = navController.currentDestination?.route
val newRoute =
Destinations.Comments.route.replace(Destinations.Comments.placeholder, postId)
)
if (currentRoute != Destinations.Comments.route) navController.navigate(newRoute)
}
override fun viewCommentsPage(commentsUrl: String) {