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

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Backup and restore options for saved posts * Backup and restore options for saved posts
### Fixed
* Spamming the comments button no longer causes it to be opened multiple times
## [1.28.0] - 2023-06-03 ## [1.28.0] - 2023-06-03
### Changed ### Changed

View file

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