Skip to content

Commit

Permalink
Poll Detail - MKR Count by Option histogram - error when same address…
Browse files Browse the repository at this point in the history
… voting multiple times
  • Loading branch information
lmcorbalan committed May 7, 2020
1 parent dff0d8c commit 7c25e32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/PollDetails/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export const getPollMakerHistogramData = async poll => {
const periods = getPollPeriods(poll)

const pollOptions = ['Abstein', ...poll.options]

const options = pollOptions.reduce((acc, el) => {
return {
...acc,
Expand Down Expand Up @@ -254,7 +255,9 @@ export const getPollMakerHistogramData = async poll => {
options[option] = new Set([...Array.from(options[option])]).add(el.sender)
voters[el.sender] = option

if (prevVote) options[prevVote] = options[prevVote].delete(el.sender)
if (prevVote) {
options[prevVote].delete(el.sender)
}
}
})
return {
Expand Down

0 comments on commit 7c25e32

Please sign in to comment.