From a0276c4873f2f8e344835d2c4597c83a1c713ed6 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 16 Sep 2024 12:30:37 +0530 Subject: [PATCH] Revert "fix(common): reintroduce handling for first views for comment state" This reverts commit 1cbd3b5bd0940cbee5098dac1e164f17cf09e669. --- .../dev/msfjarvis/claw/common/comments/CommentNode.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt index a9a7ec1d..30f1e347 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt @@ -67,12 +67,8 @@ internal fun createListNode( comments: List, commentState: PostComments, ): MutableList { - // 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() + val isUnread = { id: String -> !commentState.commentIds.contains(id) } for (i in comments.indices) { if (comments[i].parentComment == null) {