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 {