Fix for old gathers schema

This commit is contained in:
Chris Blanchard 2015-10-04 13:25:06 +01:00
parent ec853bedfd
commit 6290d1de38

View file

@ -945,6 +945,10 @@ var GatherVotingResults = React.createClass({
countVotes(voteType) {
return this.props.gather.gatherers.reduce((acc, gatherer) => {
let votes = gatherer[voteType];
// Temporary fix because some mapvotes are ints and not arrays
if (!Array.isArray(votes)) votes = [votes];
if (votes.length > 0) votes.forEach(vote => acc.push(vote));
return acc;
}, []);