fix pleroma vote count, fix #398
This commit is contained in:
parent
ebce6282c5
commit
74eed7e8ba
|
@ -45,7 +45,15 @@ export class PollComponent implements OnInit {
|
|||
}
|
||||
|
||||
this.options.length = 0;
|
||||
const maxVotes = Math.max(...this.poll.options.map(x => x.votes_count));
|
||||
|
||||
let maxVotes = Math.max(...this.poll.options.map(x => x.votes_count));
|
||||
|
||||
if(!this.poll.multiple){ //Fix for absurd values in pleroma
|
||||
this.poll.voters_count = this.poll.votes_count;
|
||||
} else if(this.poll.voters_count * this.poll.options.length < this.poll.votes_count){
|
||||
this.poll.voters_count = this.poll.votes_count;
|
||||
}
|
||||
|
||||
let i = 0;
|
||||
for (let opt of this.poll.options) {
|
||||
let optWrapper = new PollOptionWrapper(i, opt, this.poll.votes_count, this.poll.voters_count, opt.votes_count === maxVotes);
|
||||
|
|
Loading…
Reference in New Issue