mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-09 11:38:40 +01:00
enhancement: retain comment expanded state when loading more or refreshing (#1012)
This commit is contained in:
parent
1d9aeba452
commit
65c03c635c
@ -479,7 +479,9 @@ class PostDetailViewModel(
|
||||
.populateLoadMoreComments()
|
||||
.map {
|
||||
it.copy(
|
||||
expanded = autoExpandComments,
|
||||
// retain comment expand state if refreshing or loading more
|
||||
expanded = currentState.comments.firstOrNull() { comment -> comment.id == it.id }?.expanded
|
||||
?: autoExpandComments,
|
||||
// only first level are visible and can be expanded
|
||||
visible = autoExpandComments || it.depth == 0,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user