mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 00:37:03 +05:30
fix(common): handle pluralization for unread comments note
This commit is contained in:
parent
2109bcf12c
commit
b0b47d98a5
1 changed files with 5 additions and 1 deletions
|
@ -65,7 +65,11 @@ internal fun CommentsPageInternal(
|
||||||
if (details.comments.isNotEmpty() && commentState.commentIds.isNotEmpty()) {
|
if (details.comments.isNotEmpty() && commentState.commentIds.isNotEmpty()) {
|
||||||
val unreadCount = details.comments.size - commentState.commentIds.size
|
val unreadCount = details.comments.size - commentState.commentIds.size
|
||||||
if (unreadCount > 0) {
|
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()
|
Toast.makeText(context, text, Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue