From aea2b7c7f348f8333ee9bd1d90258938db9864a5 Mon Sep 17 00:00:00 2001 From: Stypox Date: Mon, 11 Nov 2024 14:56:48 +0100 Subject: [PATCH] Show correct reply count in dialog --- .../video/comment/CommentRepliesDialog.kt | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt index 6ef43bec8..ba6ba7517 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt @@ -116,6 +116,24 @@ private fun CommentRepliesDialog( ) } + if (parentComment.replyCount >= 0) { + item { + Text( + modifier = Modifier.padding( + horizontal = 12.dp, + vertical = 4.dp + ), + text = pluralStringResource( + R.plurals.replies, + parentComment.replyCount, + parentComment.replyCount, + ), + maxLines = 1, + style = MaterialTheme.typography.titleMedium + ) + } + } + if (comments.itemCount == 0) { item { val refresh = comments.loadState.refresh @@ -131,21 +149,6 @@ private fun CommentRepliesDialog( } } } else { - if (comments.itemCount >= 0) { - item { - Text( - modifier = Modifier.padding( - horizontal = 12.dp, - vertical = 4.dp - ), - text = pluralStringResource( - R.plurals.replies, comments.itemCount, comments.itemCount - ), - maxLines = 1, - style = MaterialTheme.typography.titleMedium - ) - } - } items(comments.itemCount) { Comment( comment = comments[it]!!,