fix: 无法删除自己的回贴

This commit is contained in:
HuanCheng65 2024-02-02 17:03:20 +08:00
parent a8fa7c71fa
commit 9382e30885
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
1 changed files with 4 additions and 0 deletions

View File

@ -61,7 +61,10 @@ object PbPageRepository {
}
val userList = response.data_.user_list
val postList = response.data_.post_list.map {
val author = it.author
?: userList.first { user -> user.id == it.author_id }
it.copy(
author_id = author.id,
author = it.author
?: userList.first { user -> user.id == it.author_id },
from_forum = response.data_.forum,
@ -81,6 +84,7 @@ object PbPageRepository {
}
val firstPost = postList.firstOrNull { it.floor == 1 }
?: response.data_.first_floor_post?.copy(
author_id = response.data_.thread.author.id,
author = response.data_.thread.author,
from_forum = response.data_.forum,
tid = response.data_.thread.id,