Poll fixes (#1238)

* update cache when voting on a poll

* fix poll controls color

* don't allow voting on old poll from cache

* check for RecyclerView.NO_POSITION in click listener

* fix crash when voting in a boosted poll
This commit is contained in:
Konrad Pozniak 2019-05-05 08:26:17 +02:00 committed by GitHub
commit b8c32a96de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 85 additions and 31 deletions

View file

@ -622,9 +622,12 @@ public class TimelineFragment extends SFragment implements
}
public void onVoteInPoll(int position, @NonNull List<Integer> choices) {
final Status status = statuses.get(position).asRight();
setVoteForPoll(position, status, status.getPoll().votedCopy(choices));
Poll votedPoll = status.getActionableStatus().getPoll().votedCopy(choices);
setVoteForPoll(position, status, votedPoll);
timelineCases.voteInPoll(status, choices)
.observeOn(AndroidSchedulers.mainThread())