fix boost button not updating when boosting (#4048)

This commit is contained in:
Konrad Pozniak 2023-10-07 08:59:36 +02:00 committed by GitHub
commit 9412ffba0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -51,7 +51,13 @@ class TimelineCases @Inject constructor(
} else {
mastodonApi.unreblogStatus(statusId)
}.onSuccess { status ->
eventHub.dispatch(StatusChangedEvent(status))
if (status.reblog != null) {
// when reblogging, the Mastodon Api does not return the reblogged status directly
// but the newly created status with reblog set to the reblogged status
eventHub.dispatch(StatusChangedEvent(status.reblog))
} else {
eventHub.dispatch(StatusChangedEvent(status))
}
}
}