fix boost/fav count resetting after boosting a detailed status
This commit is contained in:
parent
83dc45be35
commit
88ce1a1d79
1 changed files with 6 additions and 5 deletions
|
@ -254,7 +254,6 @@ public final class ViewThreadFragment extends SFragment implements
|
||||||
public void onFavourite(final boolean favourite, final int position) {
|
public void onFavourite(final boolean favourite, final int position) {
|
||||||
final Status status = statuses.get(position);
|
final Status status = statuses.get(position);
|
||||||
|
|
||||||
|
|
||||||
timelineCases.favourite(statuses.get(position), favourite)
|
timelineCases.favourite(statuses.get(position), favourite)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.as(autoDisposable(from(this)))
|
.as(autoDisposable(from(this)))
|
||||||
|
@ -270,11 +269,13 @@ public final class ViewThreadFragment extends SFragment implements
|
||||||
private void updateStatus(int position, Status status) {
|
private void updateStatus(int position, Status status) {
|
||||||
if(position >= 0 && position < statuses.size()) {
|
if(position >= 0 && position < statuses.size()) {
|
||||||
|
|
||||||
|
Status actionableStatus = status.getActionableStatus();
|
||||||
|
|
||||||
StatusViewData.Concrete viewData = new StatusViewData.Builder(statuses.getPairedItem(position))
|
StatusViewData.Concrete viewData = new StatusViewData.Builder(statuses.getPairedItem(position))
|
||||||
.setReblogged(status.getReblogged())
|
.setReblogged(actionableStatus.getReblogged())
|
||||||
.setReblogsCount(status.getReblogsCount())
|
.setReblogsCount(actionableStatus.getReblogsCount())
|
||||||
.setFavourited(status.getFavourited())
|
.setFavourited(actionableStatus.getFavourited())
|
||||||
.setFavouritesCount(status.getFavouritesCount())
|
.setFavouritesCount(actionableStatus.getFavouritesCount())
|
||||||
.createStatusViewData();
|
.createStatusViewData();
|
||||||
statuses.setPairedItem(position, viewData);
|
statuses.setPairedItem(position, viewData);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue