Skip to content

Commit

Permalink
Show correct reply count in dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Nov 11, 2024
1 parent 37d1c78 commit aea2b7c
Showing 1 changed file with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]!!,
Expand Down

0 comments on commit aea2b7c

Please sign in to comment.