fix boost button not updating when boosting (#4048)
This commit is contained in:
parent
0fad9729ef
commit
9412ffba0f
|
@ -725,6 +725,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
|||
listener.onReblog(!buttonState, position);
|
||||
if(!buttonState) {
|
||||
reblogButton.playAnimation();
|
||||
reblogButton.setChecked(true);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
@ -746,6 +747,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
|||
listener.onFavourite(!buttonState, position);
|
||||
if(!buttonState) {
|
||||
favouriteButton.playAnimation();
|
||||
favouriteButton.setChecked(true);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue