Skip to content

Commit

Permalink
Fix poll fraction calculation for Pleroma
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen4n committed Oct 20, 2023
1 parent 28e816f commit 4535958
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public PollOptionStatusDisplayItem(String parentID, Poll poll, int optionIndex,
text=HtmlParser.parseCustomEmoji(option.title, poll.emojis);
emojiHelper.setText(text);
showResults=poll.isExpired() || poll.voted;
int total=poll.votersCount>0 ? poll.votersCount : poll.votesCount;
int total=poll.votesCount;
if(showResults && option.votesCount!=null && total>0){
votesFraction=(float)option.votesCount/(float)total;
int mostVotedCount=0;
Expand Down

0 comments on commit 4535958

Please sign in to comment.