Skip to content

Commit aea2b7c

Browse files
committed
Show correct reply count in dialog
1 parent 37d1c78 commit aea2b7c

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,24 @@ private fun CommentRepliesDialog(
116116
)
117117
}
118118

119+
if (parentComment.replyCount >= 0) {
120+
item {
121+
Text(
122+
modifier = Modifier.padding(
123+
horizontal = 12.dp,
124+
vertical = 4.dp
125+
),
126+
text = pluralStringResource(
127+
R.plurals.replies,
128+
parentComment.replyCount,
129+
parentComment.replyCount,
130+
),
131+
maxLines = 1,
132+
style = MaterialTheme.typography.titleMedium
133+
)
134+
}
135+
}
136+
119137
if (comments.itemCount == 0) {
120138
item {
121139
val refresh = comments.loadState.refresh
@@ -131,21 +149,6 @@ private fun CommentRepliesDialog(
131149
}
132150
}
133151
} else {
134-
if (comments.itemCount >= 0) {
135-
item {
136-
Text(
137-
modifier = Modifier.padding(
138-
horizontal = 12.dp,
139-
vertical = 4.dp
140-
),
141-
text = pluralStringResource(
142-
R.plurals.replies, comments.itemCount, comments.itemCount
143-
),
144-
maxLines = 1,
145-
style = MaterialTheme.typography.titleMedium
146-
)
147-
}
148-
}
149152
items(comments.itemCount) {
150153
Comment(
151154
comment = comments[it]!!,

0 commit comments

Comments
 (0)