更新关注逻辑

This commit is contained in:
2024-12-01 15:13:47 +08:00
parent 79fccda1aa
commit c54d5c914a
14 changed files with 199 additions and 156 deletions

View File

@@ -349,4 +349,15 @@ class MomentLoader : DataLoader<MomentEntity,MomentLoaderExtraArgs>() {
onListChanged?.invoke(this.list)
}
fun updateFollowStatus(authorId:Int,isFollow:Boolean) {
this.list = this.list.map { momentItem ->
if (momentItem.authorId == authorId) {
momentItem.copy(followStatus = isFollow)
} else {
momentItem
}
}.toMutableList()
onListChanged?.invoke(this.list)
}
}