fix: 贴子点赞状态更新

This commit is contained in:
HuanCheng65 2023-07-13 21:57:34 +08:00
parent d460b34ebb
commit 2ba6b9cc1c
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
1 changed files with 3 additions and 12 deletions

View File

@ -775,28 +775,19 @@ sealed interface ThreadPartialChange : PartialChange<ThreadUiState> {
return when (this) {
is Start -> oldState.copy(
threadInfo = oldState.threadInfo?.getImmutable {
updateCollectStatus(
newStatus = 0,
markPostId = 0
)
updateAgreeStatus(hasAgree = if (hasAgree) 1 else 0)
}
)
is Success -> oldState.copy(
threadInfo = oldState.threadInfo?.getImmutable {
updateCollectStatus(
newStatus = 0,
markPostId = 0
)
updateAgreeStatus(hasAgree = if (hasAgree) 1 else 0)
}
)
is Failure -> oldState.copy(
threadInfo = oldState.threadInfo?.getImmutable {
updateCollectStatus(
newStatus = 0,
markPostId = 0
)
updateAgreeStatus(hasAgree = if (hasAgree) 1 else 0)
}
)
}