fix(common): handle pluralization for unread comments note

This commit is contained in:
Harsh Shandilya 2024-09-06 15:26:51 +05:30
parent 2109bcf12c
commit b0b47d98a5

View file

@ -65,7 +65,11 @@ internal fun CommentsPageInternal(
if (details.comments.isNotEmpty() && commentState.commentIds.isNotEmpty()) {
val unreadCount = details.comments.size - commentState.commentIds.size
if (unreadCount > 0) {
val text = "$unreadCount unread comments"
val text =
when (unreadCount) {
1 -> "$unreadCount unread comment"
else -> "$unreadCount unread comments"
}
Toast.makeText(context, text, Toast.LENGTH_SHORT).show()
}
}