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()
|
.populateLoadMoreComments()
|
||||||
.map {
|
.map {
|
||||||
it.copy(
|
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
|
// only first level are visible and can be expanded
|
||||||
visible = autoExpandComments || it.depth == 0,
|
visible = autoExpandComments || it.depth == 0,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user