fix boost/fav count resetting after boosting a detailed status

This commit is contained in:
Conny Duck 2019-02-16 15:53:56 +01:00
parent 83dc45be35
commit 88ce1a1d79
1 changed files with 6 additions and 5 deletions

View File

@ -254,7 +254,6 @@ public final class ViewThreadFragment extends SFragment implements
public void onFavourite(final boolean favourite, final int position) {
final Status status = statuses.get(position);
timelineCases.favourite(statuses.get(position), favourite)
.observeOn(AndroidSchedulers.mainThread())
.as(autoDisposable(from(this)))
@ -270,11 +269,13 @@ public final class ViewThreadFragment extends SFragment implements
private void updateStatus(int position, Status status) {
if(position >= 0 && position < statuses.size()) {
Status actionableStatus = status.getActionableStatus();
StatusViewData.Concrete viewData = new StatusViewData.Builder(statuses.getPairedItem(position))
.setReblogged(status.getReblogged())
.setReblogsCount(status.getReblogsCount())
.setFavourited(status.getFavourited())
.setFavouritesCount(status.getFavouritesCount())
.setReblogged(actionableStatus.getReblogged())
.setReblogsCount(actionableStatus.getReblogsCount())
.setFavourited(actionableStatus.getFavourited())
.setFavouritesCount(actionableStatus.getFavouritesCount())
.createStatusViewData();
statuses.setPairedItem(position, viewData);