From 7c25e32eea0d9b9bfd9837427bdf4dc2ffa101ea Mon Sep 17 00:00:00 2001 From: Lisandro Corbalan Date: Thu, 7 May 2020 15:56:16 -0300 Subject: [PATCH] Poll Detail - MKR Count by Option histogram - error when same address voting multiple times --- src/components/PollDetails/helpers.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/PollDetails/helpers.tsx b/src/components/PollDetails/helpers.tsx index da16947..0d0d573 100644 --- a/src/components/PollDetails/helpers.tsx +++ b/src/components/PollDetails/helpers.tsx @@ -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, @@ -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 {