mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 15:17:05 +05:30
fix(common): do not compute a new node if it cannot be used
This commit is contained in:
parent
0083aa69b5
commit
2ab69de686
1 changed files with 1 additions and 2 deletions
|
@ -63,13 +63,12 @@ private fun CommentsPageInternal(
|
|||
nodes = commentNodes,
|
||||
htmlConverter = htmlConverter,
|
||||
toggleExpanded = { node ->
|
||||
val newNode = toggleAllExpanded(node)
|
||||
// TODO(anunaym14): make this search recursive
|
||||
val index =
|
||||
commentNodes.indexOf(commentNodes.find { it.comment.url == node.comment.url })
|
||||
if (index != -1) {
|
||||
commentNodes.removeAt(index)
|
||||
commentNodes.add(index, newNode)
|
||||
commentNodes.add(index, toggleAllExpanded(node))
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue