fix poll total vote double count (#2464)

This commit is contained in:
Sam Lade 2023-12-16 19:12:25 +00:00 committed by GitHub
parent 285d55dda8
commit 07bd848028
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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