From 818d85feccb1bf1fcf5ca4a1fa6d05cbcca7b722 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Sat, 16 Feb 2019 15:53:56 +0100 Subject: [PATCH] fix boost/fav count resetting after boosting a detailed status --- .../tusky/fragment/ViewThreadFragment.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java index cc94e3a1..c7b9fddd 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java @@ -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);