Skip to content

Commit

Permalink
fix poll total vote double count (#2464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sentynel authored and tsmethurst committed Jan 10, 2024
1 parent f4fcffc commit b141500
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/typeutils/internaltofrontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,9 @@ func (c *Converter) PollToAPIPoll(ctx context.Context, requester *gtsmodel.Accou
// disabled, or the requester is the author
// do we actually populate the vote counts.

// If we voted in this poll, we'll have set totalVotes
// earlier. Reset here to avoid double counting.
totalVotes = 0
if *poll.Multiple {
// The total number of voters are only
// provided in the case of a multiple
Expand Down

0 comments on commit b141500

Please sign in to comment.