更新关注逻辑
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user