fix: address regression in comment collapse

This commit is contained in:
Harsh Shandilya 2025-06-02 21:52:19 +05:30
parent 8947c3a3bc
commit 764be07cc0
2 changed files with 4 additions and 12 deletions

View file

@ -62,14 +62,7 @@ internal class CommentsHandler {
return node.copy(children = updatedChildren)
}
val listNode = _listItems.value.toMutableList()
for (i in listNode.indices) {
val node = listNode[i]
if (node.comment.shortId == shortId || node.children.any { it.comment.shortId == shortId }) {
listNode[i] = updateNode(node)
_listItems.value = listNode.toList()
return
}
}
val listNode = _listItems.value.map { updateNode(it) }
_listItems.value = listNode
}
}