Skip to content

Commit

Permalink
fix boost button not updating when boosting (#4048)
Browse files Browse the repository at this point in the history
  • Loading branch information
connyduck authored Oct 7, 2023
1 parent 0fad972 commit 9412ffb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ private void showConfirmReblog(StatusActionListener listener,
listener.onReblog(!buttonState, position);
if(!buttonState) {
reblogButton.playAnimation();
reblogButton.setChecked(true);
}
return true;
});
Expand All @@ -746,6 +747,7 @@ private void showConfirmFavourite(StatusActionListener listener,
listener.onFavourite(!buttonState, position);
if(!buttonState) {
favouriteButton.playAnimation();
favouriteButton.setChecked(true);
}
return true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}

Expand Down

0 comments on commit 9412ffb

Please sign in to comment.