fix: 点赞状态更新后不重组

This commit is contained in:
HuanCheng65 2023-10-08 01:02:44 +08:00
parent e711e6e4df
commit 2d52b45ec1
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
2 changed files with 4 additions and 6 deletions

View File

@ -119,7 +119,7 @@ fun UserLikeForumPage(
lazyListState = lazyListState
) {
UserLikeForumList(
forums = { forums },
data = forums,
onClickForum = { forumBean ->
forumBean.name?.let {
navigator.navigate(ForumPageDestination(it))
@ -142,11 +142,10 @@ fun UserLikeForumPage(
@Composable
private fun UserLikeForumList(
forums: () -> ImmutableList<UserLikeForumBean.ForumBean>,
data: ImmutableList<UserLikeForumBean.ForumBean>,
onClickForum: (UserLikeForumBean.ForumBean) -> Unit,
lazyListState: LazyListState = rememberLazyListState(),
) {
val data = remember(forums) { forums() }
MyLazyColumn(state = lazyListState) {
items(
items = data,

View File

@ -204,7 +204,7 @@ fun UserPostPage(
lazyListState = lazyListState
) {
UserPostList(
posts = { posts },
data = posts,
lazyListState = lazyListState,
onClickItem = {
navigator.navigate(
@ -262,7 +262,7 @@ fun UserPostPage(
@Composable
private fun UserPostList(
posts: () -> ImmutableList<ImmutableHolder<PostInfoList>>,
data: ImmutableList<ImmutableHolder<PostInfoList>>,
lazyListState: LazyListState = rememberLazyListState(),
onClickItem: (PostInfoList) -> Unit = {},
onAgreeItem: (PostInfoList) -> Unit = {},
@ -271,7 +271,6 @@ private fun UserPostList(
onClickForum: (name: String) -> Unit = {},
onClickOriginThread: (OriginThreadInfo) -> Unit = {},
) {
val data = remember(posts) { posts() }
MyLazyColumn(state = lazyListState) {
items(
items = data,