Revert "fix(common): reintroduce handling for first views for comment state"

This reverts commit 1cbd3b5bd0.
This commit is contained in:
Harsh Shandilya 2024-09-16 12:30:37 +05:30
parent fbb13c5acf
commit a0276c4873

View file

@ -67,12 +67,8 @@ internal fun createListNode(
comments: List<Comment>,
commentState: PostComments,
): MutableList<CommentNode> {
// Only check unread state if there any comments read in the first place. This somewhat restores
// the first view behavior from when `commentState` was nullable.
val hasUnread = commentState.commentIds.isNotEmpty()
val isUnread =
if (hasUnread) ({ id: String -> !commentState.commentIds.contains(id) }) else { _ -> false }
val commentNodes = mutableListOf<CommentNode>()
val isUnread = { id: String -> !commentState.commentIds.contains(id) }
for (i in comments.indices) {
if (comments[i].parentComment == null) {